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
+7
-12
No files matched your search
+5
-8
@@ -112,31 +112,28 @@ void loopM5() {
|
|||||||
}
|
}
|
||||||
previousBtnState = currentBtnState;
|
previousBtnState = currentBtnState;
|
||||||
static int previousLogLevel;
|
static int previousLogLevel;
|
||||||
switch (Log.getLastMsgLevel()) {
|
int currentLogLevel = Log.getLastMsgLevel();
|
||||||
|
if (previousLogLevel != currentLogLevel && lowpowermode != 2) {
|
||||||
|
switch (currentLogLevel) {
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
if (lowpowermode != 2) {
|
|
||||||
wakeScreen(NORMAL_LCD_BRIGHTNESS);
|
wakeScreen(NORMAL_LCD_BRIGHTNESS);
|
||||||
M5.Lcd.fillScreen(TFT_RED); // FATAL, ERROR
|
M5.Lcd.fillScreen(TFT_RED); // FATAL, ERROR
|
||||||
M5.Lcd.setTextColor(TFT_BLACK, TFT_RED);
|
M5.Lcd.setTextColor(TFT_BLACK, TFT_RED);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (lowpowermode != 2) {
|
|
||||||
wakeScreen(NORMAL_LCD_BRIGHTNESS);
|
wakeScreen(NORMAL_LCD_BRIGHTNESS);
|
||||||
M5.Lcd.fillScreen(TFT_ORANGE); // WARNING
|
M5.Lcd.fillScreen(TFT_ORANGE); // WARNING
|
||||||
M5.Lcd.setTextColor(TFT_BLACK, TFT_ORANGE);
|
M5.Lcd.setTextColor(TFT_BLACK, TFT_ORANGE);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (previousLogLevel != Log.getLastMsgLevel() && lowpowermode != 2) {
|
|
||||||
wakeScreen(SLEEP_LCD_BRIGHTNESS);
|
wakeScreen(SLEEP_LCD_BRIGHTNESS);
|
||||||
M5.Lcd.fillScreen(TFT_WHITE);
|
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);
|
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
|
void MQTTtoM5(char* topicOri, JsonObject& M5data) { // json object decoding
|
||||||
|
|||||||
@@ -755,12 +755,10 @@ void startProcessing() {
|
|||||||
|
|
||||||
void coreTask(void* pvParameters) {
|
void coreTask(void* pvParameters) {
|
||||||
while (true) {
|
while (true) {
|
||||||
Log.trace(F("BT Task running on core: %d" CR), xPortGetCoreID());
|
|
||||||
if (!ProcessLock) {
|
if (!ProcessLock) {
|
||||||
int n = 0;
|
int n = 0;
|
||||||
while (client.state() != 0 && n <= InitialMQTTConnectionTimeout && !ProcessLock) {
|
while (client.state() != 0 && n <= InitialMQTTConnectionTimeout && !ProcessLock) {
|
||||||
n++;
|
n++;
|
||||||
Log.trace(F("Wait for MQTT on core: %d attempt: %d" CR), xPortGetCoreID(), n);
|
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
if (client.state() != 0) {
|
if (client.state() != 0) {
|
||||||
|
|||||||
+2
-2
@@ -113,8 +113,8 @@ fastled = FastLED@3.3.2
|
|||||||
onewire = OneWire
|
onewire = OneWire
|
||||||
dallastemperature = DallasTemperature
|
dallastemperature = DallasTemperature
|
||||||
m5stickc = M5StickC@0.2.0
|
m5stickc = M5StickC@0.2.0
|
||||||
m5stickcp = https://github.com/m5stack/M5StickC-Plus.git
|
m5stickcp = https://github.com/m5stack/M5StickC-Plus.git#0.0.2
|
||||||
m5stack = M5Stack@0.3.0
|
m5stack = M5Stack@0.3.1
|
||||||
smartrc-cc1101-driver-lib = SmartRC-CC1101-Driver-Lib@2.5.5
|
smartrc-cc1101-driver-lib = SmartRC-CC1101-Driver-Lib@2.5.5
|
||||||
stl = https://github.com/mike-matera/ArduinoSTL.git#7411816
|
stl = https://github.com/mike-matera/ArduinoSTL.git#7411816
|
||||||
shtc3 = https://github.com/sparkfun/SparkFun_SHTC3_Arduino_Library
|
shtc3 = https://github.com/sparkfun/SparkFun_SHTC3_Arduino_Library
|
||||||
|
|||||||
Reference in new issue
Block a user