Skip to content

Commit

Permalink
fix: set button pin pinMode when num_drive_buttons is edited
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-8 committed Nov 21, 2024
1 parent 4919a00 commit 05f13cf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gbg_program/_Save_Recall.ino
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ void settingsSerial() {
sprintf(resultBuf, "false");
} else if (strcmp(k, "NUM_DRIVE_BUTTONS") == 0) {
NUM_DRIVE_BUTTONS = constrain(atoi(v), 0, 6);
if (ENABLE_BUTTON_CTRL) {
if (USE_BUTTON_MODE_PIN) {
pinMode(BUTTON_MODE_PIN, INPUT_PULLUP);
}
for (byte i = 0; i < NUM_DRIVE_BUTTONS; i++) {
pinMode(driveButtons[i].pin, INPUT_PULLUP);
}
}
sprintf(resultBuf, "%d", NUM_DRIVE_BUTTONS);
}

Expand Down

0 comments on commit 05f13cf

Please sign in to comment.