From 82f7f52576730795387f23e885c98ddd38f102c5 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 18 Dec 2024 10:21:16 -0800 Subject: [PATCH] Starting to add some basic runtime power management --- variants/preonic/variant.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/variants/preonic/variant.cpp b/variants/preonic/variant.cpp index 4842474da..f27ae60c4 100644 --- a/variants/preonic/variant.cpp +++ b/variants/preonic/variant.cpp @@ -65,11 +65,14 @@ const uint32_t g_ADigitalPinMap[] = void initVariant() { - // LED1 & LED2 - // pinMode(PIN_LED1, OUTPUT); -// ledOff(PIN_LED1); + // Enable DC/DC converter for better power efficiency + sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE); + + // Disable debug interface if not actively debugging + NRF_CLOCK->TRACECONFIG = 0; + + // Disable unused analog inputs + NRF_SAADC->ENABLE = 0; - // pinMode(PIN_LED2, OUTPUT); -// ledOff(PIN_LED2); }