diff --git a/main/ZboardM5.ino b/main/ZboardM5.ino index 7a0b334..502ac34 100644 --- a/main/ZboardM5.ino +++ b/main/ZboardM5.ino @@ -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 diff --git a/main/ZgatewayBT.ino b/main/ZgatewayBT.ino index bf58d00..9d4eb09 100644 --- a/main/ZgatewayBT.ino +++ b/main/ZgatewayBT.ino @@ -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) { diff --git a/platformio.ini b/platformio.ini index eb99ad5..3a074ba 100644 --- a/platformio.ini +++ b/platformio.ini @@ -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