mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-27 10:21:40 +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();
|
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
|
||||||
pAdvertising->reset();
|
pAdvertising->reset();
|
||||||
pAdvertising->stop();
|
pAdvertising->stop();
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_WIRELESS_PAPER_V1_0)
|
// Extra power-saving on some devices
|
||||||
// Saving of ~1mA
|
void NimbleBluetooth::deinit()
|
||||||
// Probably applicable to other ESP32 boards - unverified
|
{
|
||||||
NimBLEDevice::deinit();
|
NimBLEDevice::deinit();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NimbleBluetooth::isActive()
|
bool NimbleBluetooth::isActive()
|
||||||
|
@ -6,6 +6,7 @@ class NimbleBluetooth : BluetoothApi
|
|||||||
public:
|
public:
|
||||||
void setup();
|
void setup();
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
void deinit();
|
||||||
void clearBonds();
|
void clearBonds();
|
||||||
bool isActive();
|
bool isActive();
|
||||||
bool isConnected();
|
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
|
// not using wifi yet, but once we are this is needed to shutoff the radio hw
|
||||||
// esp_wifi_stop();
|
// esp_wifi_stop();
|
||||||
waitEnterSleep(skipPreflight);
|
waitEnterSleep(skipPreflight);
|
||||||
|
|
||||||
|
#ifdef NIMBLE_DEINIT_FOR_DEEPSLEEP
|
||||||
|
// Extra power saving on some devices
|
||||||
|
nimbleBluetooth->deinit();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
if (shouldLoraWake(msecToWake)) {
|
if (shouldLoraWake(msecToWake)) {
|
||||||
notifySleep.notifyObservers(NULL);
|
notifySleep.notifyObservers(NULL);
|
||||||
|
@ -55,3 +55,6 @@
|
|||||||
|
|
||||||
#define SX126X_DIO2_AS_RF_SWITCH
|
#define SX126X_DIO2_AS_RF_SWITCH
|
||||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
#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_DIO2_AS_RF_SWITCH
|
||||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
#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