Skip to content

Commit

Permalink
Fix: Actually Register SW14 for button press events
Browse files Browse the repository at this point in the history
SW14 has never been registered for button press events. The loop ignores it, because it's missing the last iteration.

This was most likely a copy & paste mistake from the TEST_MODE code below where SW14 is handled specially and not by a loop iterating over all buttons.
  • Loading branch information
G33KatWork authored and rfvermut committed Sep 10, 2023
1 parent 92c616e commit 5876b00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Firmware/CoverUI_V2/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void setup() {
}

#ifndef TEST_MODE
for (int i = 0; i < 13; ++i) {
for (int i = 0; i < 14; ++i) {
SW[i].onPress([](int idx, int v, int up) {
// v is 0 for release, 1-2-3 for press length
if (v > 0)
Expand Down Expand Up @@ -268,4 +268,4 @@ void loop() {
// user-defined packet to the sender.
Serial.println("Overflow!");
}
}
}

0 comments on commit 5876b00

Please sign in to comment.