diff --git a/src/main.c b/src/main.c index 182aa5d..1ec3e4c 100644 --- a/src/main.c +++ b/src/main.c @@ -343,8 +343,13 @@ interrupt(IRQ_EXTI_C, touch) { // Get time on release i16 time = elapsed(); if (time > LONG_PRESS_MS) { - // Make light continuously if pressed for long - timer = -1; + if (timer == 0) { + // Make light continuously if pressed for long + timer = -1; + } else { + // Or turn it off + timer = 0; + } } else if (time > SHORT_PRESS_MS) { // If it was short touch set timer for enough time timer = PRESS_ACTIVATION_TIME; // 30 seconds * 4 (250ms tick)