Merge branch 'master' into tft-gui-work

This commit is contained in:
Manuel 2024-04-04 11:07:59 +02:00 committed by GitHub
commit 5a6bc001d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -112,6 +112,12 @@ void NimbleBluetooth::shutdown()
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
pAdvertising->reset();
pAdvertising->stop();
#if defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_WIRELESS_PAPER_V1_0)
// Saving of ~1mA
// Probably applicable to other ESP32 boards - unverified
NimBLEDevice::deinit();
#endif
}
bool NimbleBluetooth::isActive()

View File

@ -277,6 +277,17 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false)
if (shouldLoraWake(msecToWake)) {
enableLoraInterrupt();
}
#if defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_WIRELESS_PAPER_V1_0) // Applicable to most ESP32 boards?
// Avoid leakage through button pin
pinMode(BUTTON_PIN, INPUT);
rtc_gpio_hold_en((gpio_num_t)BUTTON_PIN);
// LoRa CS (RADIO_NSS) needs to stay HIGH, even during deep sleep
pinMode(LORA_CS, OUTPUT);
digitalWrite(LORA_CS, HIGH);
rtc_gpio_hold_en((gpio_num_t)LORA_CS);
#endif
#endif
cpuDeepSleep(msecToWake);
}