mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
cleanup
This commit is contained in:
parent
2f7aa6d9a1
commit
ce87156a43
3 changed files with 3 additions and 6 deletions
|
|
@ -97,6 +97,7 @@ void Button::handleStateChange() {
|
||||||
} else {
|
} else {
|
||||||
// Long press already handled in update()
|
// Long press already handled in update()
|
||||||
_state = IDLE;
|
_state = IDLE;
|
||||||
|
_clickCount = 0; // Reset click count after long press
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
// Button timing configuration
|
// Button timing configuration
|
||||||
#define BUTTON_DEBOUNCE_TIME_MS 50 // Debounce time in ms
|
#define BUTTON_DEBOUNCE_TIME_MS 50 // Debounce time in ms
|
||||||
#define BUTTON_CLICK_TIMEOUT_MS 400 // Max time between clicks for multi-click
|
#define BUTTON_CLICK_TIMEOUT_MS 500 // Max time between clicks for multi-click
|
||||||
#define BUTTON_LONG_PRESS_TIME_MS 5000 // Time to trigger long press (5 seconds)
|
#define BUTTON_LONG_PRESS_TIME_MS 5000 // Time to trigger long press (5 seconds)
|
||||||
#define BUTTON_READ_INTERVAL_MS 10 // How often to read the button
|
#define BUTTON_READ_INTERVAL_MS 10 // How often to read the button
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -311,12 +311,8 @@ void UITask::handleButtonAnyPress() {
|
||||||
if (_display != NULL) {
|
if (_display != NULL) {
|
||||||
if (!_display->isOn()) {
|
if (!_display->isOn()) {
|
||||||
_display->turnOn();
|
_display->turnOn();
|
||||||
_need_refresh = true;
|
|
||||||
} else {
|
|
||||||
// Turn on display
|
|
||||||
_display->turnOn();
|
|
||||||
_need_refresh = true;
|
|
||||||
}
|
}
|
||||||
|
_need_refresh = true;
|
||||||
_auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer
|
_auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue