From 30b26656eb497a8ca07f7047402a2e4e202e3748 Mon Sep 17 00:00:00 2001 From: mverch67 Date: Thu, 11 Apr 2024 22:49:43 +0200 Subject: [PATCH] fix error + enable nimble deinit --- src/nimble/NimbleBluetooth.cpp | 4 ++-- src/sleep.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nimble/NimbleBluetooth.cpp b/src/nimble/NimbleBluetooth.cpp index 0b91bf44f4..42b296e457 100644 --- a/src/nimble/NimbleBluetooth.cpp +++ b/src/nimble/NimbleBluetooth.cpp @@ -113,8 +113,8 @@ void NimbleBluetooth::shutdown() pAdvertising->reset(); pAdvertising->stop(); -#if defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_WIRELESS_PAPER_V1_0) - // Saving of ~1mA +#if defined(ARCH_ESP32) + // Saving of ~1mA for esp32-s3 and 0.1mA for esp32 // Probably applicable to other ESP32 boards - unverified NimBLEDevice::deinit(); #endif diff --git a/src/sleep.cpp b/src/sleep.cpp index b128a69812..7ed2641834 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -249,9 +249,11 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false) if (shouldLoraWake(msecToWake)) { enableLoraInterrupt(); } +#ifdef BUTTON_PIN // Avoid leakage through button pin pinMode(BUTTON_PIN, INPUT); gpio_hold_en((gpio_num_t)BUTTON_PIN); +#endif // LoRa CS (RADIO_NSS) needs to stay HIGH, even during deep sleep pinMode(LORA_CS, OUTPUT);