mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 01:16:55 +00:00
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
This commit is contained in:
parent
411aedaf5d
commit
37f294d0a6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user