Analogue button delay based on millis
This commit is contained in:
@@ -700,6 +700,7 @@ void UITask::loop() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(PIN_USER_BTN_ANA)
|
#if defined(PIN_USER_BTN_ANA)
|
||||||
|
if (abs(millis() - _analogue_pin_read_millis) > 10) {
|
||||||
ev = analog_btn.check();
|
ev = analog_btn.check();
|
||||||
if (ev == BUTTON_EVENT_CLICK) {
|
if (ev == BUTTON_EVENT_CLICK) {
|
||||||
c = checkDisplayOn(KEY_NEXT);
|
c = checkDisplayOn(KEY_NEXT);
|
||||||
@@ -710,6 +711,8 @@ void UITask::loop() {
|
|||||||
} else if (ev == BUTTON_EVENT_TRIPLE_CLICK) {
|
} else if (ev == BUTTON_EVENT_TRIPLE_CLICK) {
|
||||||
c = handleTripleClick(KEY_SELECT);
|
c = handleTripleClick(KEY_SELECT);
|
||||||
}
|
}
|
||||||
|
_analogue_pin_read_millis = millis();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(DISP_BACKLIGHT) && defined(BACKLIGHT_BTN)
|
#if defined(DISP_BACKLIGHT) && defined(BACKLIGHT_BTN)
|
||||||
if (millis() > next_backlight_btn_check) {
|
if (millis() > next_backlight_btn_check) {
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ class UITask : public AbstractUITask {
|
|||||||
int last_led_increment = 0;
|
int last_led_increment = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PIN_USER_BTN_ANA
|
||||||
|
unsigned long _analogue_pin_read_millis = millis();
|
||||||
|
#endif
|
||||||
|
|
||||||
UIScreen* splash;
|
UIScreen* splash;
|
||||||
UIScreen* home;
|
UIScreen* home;
|
||||||
UIScreen* msg_preview;
|
UIScreen* msg_preview;
|
||||||
|
|||||||
Reference in New Issue
Block a user