Allow BLE when ethernet only connected

Allow BLE when ethernet only connected (#10753)
This commit is contained in:
Theo Arends 2021-02-05 14:09:46 +01:00
parent 6836455bbe
commit 5d58eb39cf
2 changed files with 14 additions and 10 deletions

View File

@ -1478,12 +1478,14 @@ static void BLEInit(void) {
if (BLEInitState) { return; } if (BLEInitState) { return; }
if (TasmotaGlobal.global_state.wifi_down) { return; } if (TasmotaGlobal.global_state.wifi_down && TasmotaGlobal.global_state.eth_down) { return; }
TasmotaGlobal.wifi_stay_asleep = true; if (!TasmotaGlobal.global_state.wifi_down) {
if (WiFi.getSleep() == false) { TasmotaGlobal.wifi_stay_asleep = true;
AddLog(LOG_LEVEL_DEBUG,PSTR("%s: Put WiFi modem in sleep mode"),"BLE"); if (WiFi.getSleep() == false) {
WiFi.setSleep(true); // Sleep AddLog(LOG_LEVEL_DEBUG,PSTR("%s: Put WiFi modem in sleep mode"), "BLE");
WiFi.setSleep(true); // Sleep
}
} }
// this is only for testing, does nothin if examples are undefed // this is only for testing, does nothin if examples are undefed

View File

@ -789,12 +789,14 @@ void MI32PreInit(void) {
void MI32Init(void) { void MI32Init(void) {
if (MI32.mode.init) { return; } if (MI32.mode.init) { return; }
if (TasmotaGlobal.global_state.wifi_down) { return; } if (TasmotaGlobal.global_state.wifi_down && TasmotaGlobal.global_state.eth_down) { return; }
TasmotaGlobal.wifi_stay_asleep = true; if (!TasmotaGlobal.global_state.wifi_down) {
if (WiFi.getSleep() == false) { TasmotaGlobal.wifi_stay_asleep = true;
AddLog(LOG_LEVEL_DEBUG,PSTR("M32: Put WiFi modem in sleep mode")); if (WiFi.getSleep() == false) {
WiFi.setSleep(true); // Sleep AddLog(LOG_LEVEL_DEBUG,PSTR("M32: Put WiFi modem in sleep mode"));
WiFi.setSleep(true); // Sleep
}
} }
if (!MI32.mode.init) { if (!MI32.mode.init) {