From 4c6f3ead6047b2438bd54cb7e9d5b0d3c449b02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 19 Sep 2022 12:05:57 +0200 Subject: [PATCH] fixing I2C requests and Wifi Power Saving Modes. --- src/input/kbI2cBase.cpp | 5 +++++ src/mesh/http/WiFiAPClient.cpp | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/input/kbI2cBase.cpp b/src/input/kbI2cBase.cpp index 4d94f31b0..e12b52e5b 100644 --- a/src/input/kbI2cBase.cpp +++ b/src/input/kbI2cBase.cpp @@ -3,6 +3,7 @@ #include extern uint8_t cardkb_found; +extern uint8_t faceskb_found; KbI2cBase::KbI2cBase(const char *name) : concurrency::OSThread(name) { @@ -11,6 +12,10 @@ KbI2cBase::KbI2cBase(const char *name) : concurrency::OSThread(name) int32_t KbI2cBase::runOnce() { + if ((cardkb_found != CARDKB_ADDR) && (faceskb_found != CARDKB_ADDR)){ + // Input device is not detected. + return INT32_MAX; + } InputEvent e; e.inputEvent = ModuleConfig_CannedMessageConfig_InputEventChar_NONE; e.source = this->_originName; diff --git a/src/mesh/http/WiFiAPClient.cpp b/src/mesh/http/WiFiAPClient.cpp index 576492a2a..db72cb760 100644 --- a/src/mesh/http/WiFiAPClient.cpp +++ b/src/mesh/http/WiFiAPClient.cpp @@ -10,6 +10,7 @@ #include "target_specific.h" #include #include +#include #include #include @@ -239,7 +240,7 @@ bool initWifi(bool forceSoftAP) DEBUG_MSG("MY IP AP ADDRESS: %s\n", WiFi.softAPIP().toString().c_str()); // This is needed to improve performance. - // esp_wifi_set_ps(WIFI_PS_NONE); // Disable radio power saving + esp_wifi_set_ps(WIFI_PS_NONE); // Disable radio power saving dnsServer.start(53, "*", apIP); @@ -253,7 +254,7 @@ bool initWifi(bool forceSoftAP) WiFi.onEvent(WiFiEvent); // This is needed to improve performance. - // esp_wifi_set_ps(WIFI_PS_NONE); // Disable radio power saving + esp_wifi_set_ps(WIFI_PS_NONE); // Disable radio power saving WiFi.onEvent( [](WiFiEvent_t event, WiFiEventInfo_t info) {