InfiniTime.git

commit 2fa3aaa1617849dd29fe55c844d5250df0cba955

Author: Jean-François Milants <jf@codingfield.com>

Power optimization - enable the DC/DC regulator.

The DC/DC regulator reduce the power consumption of the MCU compared to the default LDO regulator. The DC/DC regulator needs additional HW that is mounted on the PineTime.

This change reduces the power usage by 380µA during fast advertising, by 200µA during slow advertising and by 186µA when BLE is disabled.

 src/main.cpp | 5 +++++


diff --git a/src/main.cpp b/src/main.cpp
index aa98de3f925fc1be9b06f8cf931a5d6200f7815b..9c13a169e03d51005c3866e03a3d03c543b81915 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -304,7 +304,12 @@   // Not recursive, call is deferred via internal calibration timer
   nrf_drv_clock_calibration_start(16, calibrate_lf_clock_rc);
 }
 
+void enable_dcdc_regulator() {
+  NRF_POWER->DCDCEN = 1;
+}
+
 int main() {
+  enable_dcdc_regulator();
   logger.Init();
 
   nrf_drv_clock_init();