From c8ecf6744d707fe2b15666ada49972a8fbb78d4c Mon Sep 17 00:00:00 2001 From: nedko Date: Fri, 3 Mar 2023 14:53:25 +0200 Subject: [PATCH] Fixed prressing button while Off causing you to never be able to Off again --- ATtiny84_LED_PC.c | 6 ++++++ 1 file changed, 6 insertions(+) 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: