Resolve issue with wifi reconnection on M5Stack boards (#907)
And update libraries
This commit is contained in:
1 parent
cd55f0dfd5
commit
f01b7184a0
3 files changed
+14
-19
No files matched your search
+12
-15
@@ -112,31 +112,28 @@ void loopM5() {
|
||||
}
|
||||
previousBtnState = currentBtnState;
|
||||
static int previousLogLevel;
|
||||
switch (Log.getLastMsgLevel()) {
|
||||
case 1:
|
||||
case 2:
|
||||
if (lowpowermode != 2) {
|
||||
int currentLogLevel = Log.getLastMsgLevel();
|
||||
if (previousLogLevel != currentLogLevel && lowpowermode != 2) {
|
||||
switch (currentLogLevel) {
|
||||
case 1:
|
||||
case 2:
|
||||
wakeScreen(NORMAL_LCD_BRIGHTNESS);
|
||||
M5.Lcd.fillScreen(TFT_RED); // FATAL, ERROR
|
||||
M5.Lcd.setTextColor(TFT_BLACK, TFT_RED);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (lowpowermode != 2) {
|
||||
break;
|
||||
case 3:
|
||||
wakeScreen(NORMAL_LCD_BRIGHTNESS);
|
||||
M5.Lcd.fillScreen(TFT_ORANGE); // WARNING
|
||||
M5.Lcd.setTextColor(TFT_BLACK, TFT_ORANGE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (previousLogLevel != Log.getLastMsgLevel() && lowpowermode != 2) {
|
||||
break;
|
||||
default:
|
||||
wakeScreen(SLEEP_LCD_BRIGHTNESS);
|
||||
M5.Lcd.fillScreen(TFT_WHITE);
|
||||
drawLogo(M5.Lcd.width() * 0.1875, (M5.Lcd.width() / 2) - M5.Lcd.width() * 0.24, M5.Lcd.height() * 0.5, true, true, true, true, true, true);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
previousLogLevel = Log.getLastMsgLevel();
|
||||
previousLogLevel = currentLogLevel;
|
||||
}
|
||||
|
||||
void MQTTtoM5(char* topicOri, JsonObject& M5data) { // json object decoding
|
||||
|
||||
@@ -755,12 +755,10 @@ void startProcessing() {
|
||||
|
||||
void coreTask(void* pvParameters) {
|
||||
while (true) {
|
||||
Log.trace(F("BT Task running on core: %d" CR), xPortGetCoreID());
|
||||
if (!ProcessLock) {
|
||||
int n = 0;
|
||||
while (client.state() != 0 && n <= InitialMQTTConnectionTimeout && !ProcessLock) {
|
||||
n++;
|
||||
Log.trace(F("Wait for MQTT on core: %d attempt: %d" CR), xPortGetCoreID(), n);
|
||||
delay(1000);
|
||||
}
|
||||
if (client.state() != 0) {
|
||||
|
||||
Reference in new issue
Block a user