From ef5279e85e7cb572bafb19d01af8dd0783b580a9 Mon Sep 17 00:00:00 2001 From: Mictronics Date: Tue, 20 Aug 2024 13:04:39 +0200 Subject: [PATCH] Set RP2040 in dormant mode when deep sleep is triggered. (#4510) * Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28 * Merge PR #420 * Fixed double and missing Default class. * Use correct format specifier and fixed typo. * Removed duplicate code. * Fix error: #if with no expression * Fix warning: extra tokens at end of #endif directive. * Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board. * Fix deprecated macros. * Set RP2040 in dormant mode when deep sleep is triggered. --------- Co-authored-by: Ben Meadors --- src/platform/rp2040/main-rp2040.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/platform/rp2040/main-rp2040.cpp b/src/platform/rp2040/main-rp2040.cpp index af3aeadc3..6306f34c1 100644 --- a/src/platform/rp2040/main-rp2040.cpp +++ b/src/platform/rp2040/main-rp2040.cpp @@ -1,4 +1,5 @@ #include "configuration.h" +#include "hardware/xosc.h" #include #include #include @@ -12,7 +13,11 @@ void setBluetoothEnable(bool enable) void cpuDeepSleep(uint32_t msecs) { - // not needed + /* Disable both PLL to avoid power dissipation */ + pll_deinit(pll_sys); + pll_deinit(pll_usb); + /* Set RP2040 in dormant mode. Will not wake up. */ + xosc_dormant(); } void updateBatteryLevel(uint8_t level)