Resolve issue with wifi reconnection on M5Stack boards (#907)

And update libraries
This commit is contained in:
Florian authored and GitHub committed 2021-03-27 09:26:15 -05:00
1 parent cd55f0dfd5
commit f01b7184a0
3 files changed
+14 -19

No files matched your search

+12 -15
View File
@@ -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
-2
View File
@@ -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) {
+2 -2
View File
@@ -113,8 +113,8 @@ fastled = FastLED@3.3.2
onewire = OneWire
dallastemperature = DallasTemperature
m5stickc = M5StickC@0.2.0
m5stickcp = https://github.com/m5stack/M5StickC-Plus.git
m5stack = M5Stack@0.3.0
m5stickcp = https://github.com/m5stack/M5StickC-Plus.git#0.0.2
m5stack = M5Stack@0.3.1
smartrc-cc1101-driver-lib = SmartRC-CC1101-Driver-Lib@2.5.5
stl = https://github.com/mike-matera/ArduinoSTL.git#7411816
shtc3 = https://github.com/sparkfun/SparkFun_SHTC3_Arduino_Library