From 713f7d5996183895cb1b89a4ed4e4f50676ea288 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 10 Jan 2023 07:36:19 -0600 Subject: [PATCH] Turn of 3.3v rail on RAK-4631 on shutdown --- src/main.cpp | 2 +- src/platform/nrf52/main-nrf52.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 47236bf7d..2631e68df 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -239,7 +239,7 @@ void setup() #ifdef RAK4630 // We need to enable 3.3V periphery in order to scan it pinMode(PIN_3V3_EN, OUTPUT); - digitalWrite(PIN_3V3_EN, 1); + digitalWrite(PIN_3V3_EN, HIGH); #endif // Currently only the tbeam has a PMU diff --git a/src/platform/nrf52/main-nrf52.cpp b/src/platform/nrf52/main-nrf52.cpp index 9a942a606..e3096b0ce 100644 --- a/src/platform/nrf52/main-nrf52.cpp +++ b/src/platform/nrf52/main-nrf52.cpp @@ -172,6 +172,9 @@ void cpuDeepSleep(uint64_t msecToWake) Serial1.end(); #endif setBluetoothEnable(false); +#ifdef RAK4630 + digitalWrite(PIN_3V3_EN, LOW); +#endif // FIXME, use system off mode with ram retention for key state? // FIXME, use non-init RAM per // https://devzone.nordicsemi.com/f/nordic-q-a/48919/ram-retention-settings-with-softdevice-enabled