mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-23 17:13:38 +00:00
Wireless Paper: Fix BLE after Lightsleep (#3629)
* NimBLE deinit for deep-sleep only
* Optionally disable blink during light-sleep
* Advised to revert "blink disable"
This reverts commit 66347ce19b
.
This commit is contained in:
parent
5b52c31a76
commit
1d97544041
@ -112,12 +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
|
||||
// Extra power-saving on some devices
|
||||
void NimbleBluetooth::deinit()
|
||||
{
|
||||
NimBLEDevice::deinit();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool NimbleBluetooth::isActive()
|
||||
|
@ -6,6 +6,7 @@ class NimbleBluetooth : BluetoothApi
|
||||
public:
|
||||
void setup();
|
||||
void shutdown();
|
||||
void deinit();
|
||||
void clearBonds();
|
||||
bool isActive();
|
||||
bool isConnected();
|
||||
|
@ -206,6 +206,12 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false)
|
||||
// not using wifi yet, but once we are this is needed to shutoff the radio hw
|
||||
// esp_wifi_stop();
|
||||
waitEnterSleep(skipPreflight);
|
||||
|
||||
#ifdef NIMBLE_DEINIT_FOR_DEEPSLEEP
|
||||
// Extra power saving on some devices
|
||||
nimbleBluetooth->deinit();
|
||||
#endif
|
||||
|
||||
#ifdef ARCH_ESP32
|
||||
if (shouldLoraWake(msecToWake)) {
|
||||
notifySleep.notifyObservers(NULL);
|
||||
|
@ -55,3 +55,6 @@
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// Power management
|
||||
#define NIMBLE_DEINIT_FOR_DEEPSLEEP // Required to reach manufacturers claim of 18uA
|
||||
|
@ -55,3 +55,6 @@
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// Power management
|
||||
#define NIMBLE_DEINIT_FOR_DEEPSLEEP // Required to reach manufacturers claim of 18uA
|
||||
|
Loading…
Reference in New Issue
Block a user