mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-06 13:48:29 +00:00
fixing I2C requests and Wifi Power Saving Modes.
This commit is contained in:
parent
2d81d359b8
commit
4c6f3ead60
@ -3,6 +3,7 @@
|
|||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
|
|
||||||
extern uint8_t cardkb_found;
|
extern uint8_t cardkb_found;
|
||||||
|
extern uint8_t faceskb_found;
|
||||||
|
|
||||||
KbI2cBase::KbI2cBase(const char *name) : concurrency::OSThread(name)
|
KbI2cBase::KbI2cBase(const char *name) : concurrency::OSThread(name)
|
||||||
{
|
{
|
||||||
@ -11,6 +12,10 @@ KbI2cBase::KbI2cBase(const char *name) : concurrency::OSThread(name)
|
|||||||
|
|
||||||
int32_t KbI2cBase::runOnce()
|
int32_t KbI2cBase::runOnce()
|
||||||
{
|
{
|
||||||
|
if ((cardkb_found != CARDKB_ADDR) && (faceskb_found != CARDKB_ADDR)){
|
||||||
|
// Input device is not detected.
|
||||||
|
return INT32_MAX;
|
||||||
|
}
|
||||||
InputEvent e;
|
InputEvent e;
|
||||||
e.inputEvent = ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
|
e.inputEvent = ModuleConfig_CannedMessageConfig_InputEventChar_NONE;
|
||||||
e.source = this->_originName;
|
e.source = this->_originName;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "target_specific.h"
|
#include "target_specific.h"
|
||||||
#include <DNSServer.h>
|
#include <DNSServer.h>
|
||||||
#include <ESPmDNS.h>
|
#include <ESPmDNS.h>
|
||||||
|
#include <esp_wifi.h>
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#include <WiFiUdp.h>
|
#include <WiFiUdp.h>
|
||||||
|
|
||||||
@ -239,7 +240,7 @@ bool initWifi(bool forceSoftAP)
|
|||||||
DEBUG_MSG("MY IP AP ADDRESS: %s\n", WiFi.softAPIP().toString().c_str());
|
DEBUG_MSG("MY IP AP ADDRESS: %s\n", WiFi.softAPIP().toString().c_str());
|
||||||
|
|
||||||
// This is needed to improve performance.
|
// 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);
|
dnsServer.start(53, "*", apIP);
|
||||||
|
|
||||||
@ -253,7 +254,7 @@ bool initWifi(bool forceSoftAP)
|
|||||||
WiFi.onEvent(WiFiEvent);
|
WiFi.onEvent(WiFiEvent);
|
||||||
|
|
||||||
// This is needed to improve performance.
|
// 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(
|
WiFi.onEvent(
|
||||||
[](WiFiEvent_t event, WiFiEventInfo_t info) {
|
[](WiFiEvent_t event, WiFiEventInfo_t info) {
|
||||||
|
Loading…
Reference in New Issue
Block a user