mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-31 02:45:41 +00:00
Clear GPREGRET before setting
There are some troubles with that register: it is recommended to clear it with 0xFF mask and only after that perform a setting.
This commit is contained in:
parent
43a1976f6d
commit
61e60c974d
@ -366,6 +366,7 @@ void cpuDeepSleep(uint32_t msecToWake)
|
|||||||
// Resume on user button press
|
// Resume on user button press
|
||||||
// https://github.com/lyusupov/SoftRF/blob/81c519ca75693b696752235d559e881f2e0511ee/software/firmware/source/SoftRF/src/platform/nRF52.cpp#L1738
|
// https://github.com/lyusupov/SoftRF/blob/81c519ca75693b696752235d559e881f2e0511ee/software/firmware/source/SoftRF/src/platform/nRF52.cpp#L1738
|
||||||
constexpr uint32_t DFU_MAGIC_SKIP = 0x6d;
|
constexpr uint32_t DFU_MAGIC_SKIP = 0x6d;
|
||||||
|
sd_power_gpregret_clr(0, 0xFF); // Clear the register before setting a new values in it for stability reasons
|
||||||
sd_power_gpregret_set(0, DFU_MAGIC_SKIP); // Equivalent NRF_POWER->GPREGRET = DFU_MAGIC_SKIP
|
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 system off mode with ram retention for key state?
|
||||||
|
Loading…
Reference in New Issue
Block a user