mirror of
https://github.com/firewalkwithm3/Sensor-Watch.git
synced 2024-11-22 19:20:30 +08:00
work around silicon erratum in SUPC/VREG
This commit is contained in:
parent
89e86fe629
commit
68f3865227
|
@ -35,6 +35,10 @@ void _watch_init(void) {
|
|||
|
||||
// Use switching regulator for lower power consumption.
|
||||
SUPC->VREG.bit.SEL = 1;
|
||||
// work around a silicon erratum that causes the microcontroller to lock up on leaving standby:
|
||||
// request that the voltage regulator run in standby, and also that it switch to PL0.
|
||||
SUPC->VREG.bit.RUNSTDBY = 1;
|
||||
SUPC->VREG.bit.STDBYPL0 = 1;
|
||||
while(!SUPC->STATUS.bit.VREGRDY); // wait for voltage regulator to become ready
|
||||
|
||||
// check the battery voltage...
|
||||
|
|
Loading…
Reference in a new issue