allow to turn off light

This commit is contained in:
Vitalii 2025-05-16 10:23:22 +03:00
parent a4096473db
commit ae9789ca4a
Signed by: SymbX
GPG Key ID: FF51F4E4BCE459EE
1 changed files with 7 additions and 2 deletions

View File

@ -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)