mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
Add hardware watchdog and QuickMsgScreen
Watchdog: nRF52840 hardware WDT with 30s timeout, runs during sleep. Resets device if main loop stalls for >30s. Pets in every loop() iteration so normal operation never triggers it. QuickMsgScreen: new UI screen accessible from home screen pages. Two-phase UI: contact picker (shows all contacts with hop count), then predefined message picker (location, I'm OK, need help, on my way, ETA 10min, ETA 30min). Location message uses live GPS fix if available. Sends via the_mesh.sendMessage() and shows sent/error alert. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -221,9 +221,19 @@ void setup() {
|
||||
#ifdef DISPLAY_CLASS
|
||||
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved
|
||||
#endif
|
||||
|
||||
#ifdef NRF52_PLATFORM
|
||||
NRF_WDT->CONFIG = 0x01; // run during sleep; pause during debug halt
|
||||
NRF_WDT->CRV = 32768*30-1; // 30 second timeout
|
||||
NRF_WDT->RREN = 0x01; // enable reload register 0
|
||||
NRF_WDT->TASKS_START = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
void loop() {
|
||||
#ifdef NRF52_PLATFORM
|
||||
NRF_WDT->RR[0] = 0x6E524635UL; // pet watchdog
|
||||
#endif
|
||||
the_mesh.loop();
|
||||
sensors.loop();
|
||||
#ifdef DISPLAY_CLASS
|
||||
|
||||
Reference in New Issue
Block a user