|
|
@ -35,13 +35,15 @@ void LEDControl::next_mode(void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LEDControl::prev_mode(void) {
|
|
|
|
void LEDControl::prev_mode(void) {
|
|
|
|
mode--;
|
|
|
|
if (mode == 0) {
|
|
|
|
|
|
|
|
// wrap around
|
|
|
|
if (mode >= LED_MAX_MODES || !modes[mode]) {
|
|
|
|
mode = LED_MAX_MODES;
|
|
|
|
return set_mode(0);
|
|
|
|
// then count down until reaching a valid mode
|
|
|
|
|
|
|
|
while (mode > 0 && !modes[mode]) mode--;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
mode--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
set_mode(mode);
|
|
|
|
return set_mode(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|