diff --git a/ATtiny84_LED_PC.c b/ATtiny84_LED_PC.c index 94263a8..63aa39d 100644 --- a/ATtiny84_LED_PC.c +++ b/ATtiny84_LED_PC.c @@ -444,6 +444,12 @@ void state_switch(uint8_t is_onoff) if (is_onoff == 0) { + // If we're off don't change anything + if (func_idx == sizeof(func_list) / sizeof(func_list[0]) - 1) + { + return; + } + switch (colour_state) { case STATE_SUN_MOON: