mirror of
https://github.com/firewalkwithm3/Sensor-Watch.git
synced 2024-11-22 19:20:30 +08:00
annotate SLEEPCFG-register detail
This commit is contained in:
parent
af49d3cfcb
commit
a2a60eb31a
|
@ -57,7 +57,13 @@ int sleep(const uint8_t mode)
|
||||||
if (ERR_NONE != _set_sleep_mode(mode))
|
if (ERR_NONE != _set_sleep_mode(mode))
|
||||||
return ERR_INVALID_ARG;
|
return ERR_INVALID_ARG;
|
||||||
|
|
||||||
// wait for the mode set to actually take, per chip doc.
|
// wait for the mode set to actually take, per note in Microchip data
|
||||||
|
// sheet DS60001465, section 19.8.2:
|
||||||
|
//
|
||||||
|
// A small latency happens between the store instruction and actual
|
||||||
|
// writing of the SLEEPCFG register due to bridges. Software has to make
|
||||||
|
// sure the SLEEPCFG register reads the wanted value before issuing WFI
|
||||||
|
// instruction.
|
||||||
while(_get_sleep_mode() != mode);
|
while(_get_sleep_mode() != mode);
|
||||||
|
|
||||||
_go_to_sleep();
|
_go_to_sleep();
|
||||||
|
|
Loading…
Reference in a new issue