diff options
author | Joey Castillo <joeycastillo@utexas.edu> | 2022-02-13 14:15:00 -0500 |
---|---|---|
committer | Joey Castillo <joeycastillo@utexas.edu> | 2022-02-13 14:15:00 -0500 |
commit | b91f025542b4be42182de218630ea442eb119ddc (patch) | |
tree | 7a29d938498c3c32a26432a462e033053ad79bab /watch-library/hardware/watch/watch.c | |
parent | 203850104d9ec2929cc7f0d4e280107986248006 (diff) | |
download | Sensor-Watch-b91f025542b4be42182de218630ea442eb119ddc.tar.gz Sensor-Watch-b91f025542b4be42182de218630ea442eb119ddc.tar.bz2 Sensor-Watch-b91f025542b4be42182de218630ea442eb119ddc.zip |
enable high-efficiency low power regulator
Diffstat (limited to 'watch-library/hardware/watch/watch.c')
-rw-r--r-- | watch-library/hardware/watch/watch.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/watch-library/hardware/watch/watch.c b/watch-library/hardware/watch/watch.c index 934d5623..32bbccbb 100644 --- a/watch-library/hardware/watch/watch.c +++ b/watch-library/hardware/watch/watch.c @@ -27,7 +27,13 @@ // receives interrupts from MCLK, OSC32KCTRL, OSCCTRL, PAC, PM, SUPC and TAL, whatever that is. void SYSTEM_Handler(void) { if (SUPC->INTFLAG.bit.BOD33DET) { + // Our system voltage has dipped below 2.6V! + // Set the voltage regulator to work at low system voltage before we hit 2.5 V + // This voltage regulator can carry us down to 1.62 volts as the battery drains. + SUPC->VREG.bit.LPEFF = 0; + // clear the interrupt condition SUPC->INTENCLR.bit.BOD33DET = 1; + // and disable the brownout detector (TODO: add a second, "power critical" brownout condition?) SUPC->INTFLAG.reg &= ~SUPC_INTFLAG_BOD33DET; } } |