allow to turn off light
This commit is contained in:
parent
a4096473db
commit
ae9789ca4a
|
|
@ -343,8 +343,13 @@ interrupt(IRQ_EXTI_C, touch) {
|
||||||
// Get time on release
|
// Get time on release
|
||||||
i16 time = elapsed();
|
i16 time = elapsed();
|
||||||
if (time > LONG_PRESS_MS) {
|
if (time > LONG_PRESS_MS) {
|
||||||
// Make light continuously if pressed for long
|
if (timer == 0) {
|
||||||
timer = -1;
|
// Make light continuously if pressed for long
|
||||||
|
timer = -1;
|
||||||
|
} else {
|
||||||
|
// Or turn it off
|
||||||
|
timer = 0;
|
||||||
|
}
|
||||||
} else if (time > SHORT_PRESS_MS) {
|
} else if (time > SHORT_PRESS_MS) {
|
||||||
// If it was short touch set timer for enough time
|
// If it was short touch set timer for enough time
|
||||||
timer = PRESS_ACTIVATION_TIME; // 30 seconds * 4 (250ms tick)
|
timer = PRESS_ACTIVATION_TIME; // 30 seconds * 4 (250ms tick)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue