In shutdown, on button press, wake back to application rather than into the loader. (#4997)

Suggested by lyusupov and implemented by todd-herbert.
https://github.com/meshtastic/firmware/issues/4651
pull/4976/head^2
jhps 2024-10-07 18:39:59 -07:00 zatwierdzone przez GitHub
rodzic 411aedaf5d
commit 37f294d0a6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -270,6 +270,11 @@ void cpuDeepSleep(uint32_t msecToWake)
delay(msecToWake);
NVIC_SystemReset();
} else {
// Resume on user button press
// https://github.com/lyusupov/SoftRF/blob/81c519ca75693b696752235d559e881f2e0511ee/software/firmware/source/SoftRF/src/platform/nRF52.cpp#L1738
constexpr uint32_t DFU_MAGIC_SKIP = 0x6d;
sd_power_gpregret_set(0, DFU_MAGIC_SKIP); // Equivalent NRF_POWER->GPREGRET = DFU_MAGIC_SKIP
// FIXME, use system off mode with ram retention for key state?
// FIXME, use non-init RAM per
// https://devzone.nordicsemi.com/f/nordic-q-a/48919/ram-retention-settings-with-softdevice-enabled