mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* Companion: long-press in first 8 seconds now enters CLI Rescue mode
This commit is contained in:
parent
5d15a68d0d
commit
647d712ae8
5 changed files with 99 additions and 5 deletions
|
|
@ -75,6 +75,7 @@ void UITask::begin(DisplayDriver* display, NodePrefs* node_prefs) {
|
|||
_userButton->onLongPress([this]() { handleButtonLongPress(); });
|
||||
_userButton->onAnyPress([this]() { handleButtonAnyPress(); });
|
||||
#endif
|
||||
ui_started_at = millis();
|
||||
}
|
||||
|
||||
void UITask::soundBuzzer(UIEventType bet) {
|
||||
|
|
@ -365,5 +366,9 @@ void UITask::handleButtonTriplePress() {
|
|||
|
||||
void UITask::handleButtonLongPress() {
|
||||
MESH_DEBUG_PRINTLN("UITask: long press triggered");
|
||||
shutdown();
|
||||
if (millis() - ui_started_at < 8000) { // long press in first 8 seconds since startup -> CLI/rescue
|
||||
the_mesh.enterCLIRescue();
|
||||
} else {
|
||||
shutdown();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue