Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .at() for indexing instead of C style array indices #58

Merged
merged 7 commits into from
Mar 31, 2023

Conversation

JoshuaAN
Copy link
Member

No description provided.

@JoshuaAN
Copy link
Member Author

This throws an exception on out of bounds array accesses rather than a segfault

constexpr int kRedBlueSwitchPort = 10;

/// LED strip
constexpr int kLEDStripLength = 22;
constexpr int kAltLEDStripLength = 18;
constexpr int kLEDBuffLength = kLEDStripLength * 4 + kAltLEDStripLength;
constexpr bool kStripDirections[] = {false, true, true,
true}; // false means up, true means down
const std::vector<bool> kStripDirections = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may violate this issue: #56

@jlbabilino jlbabilino merged commit 2e0c3b1 into main Mar 31, 2023
@jlbabilino jlbabilino deleted the bug-fix/use-at-indexing branch March 31, 2023 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants