From c9762995d9112ff004d48114c78c5e29fbb63438 Mon Sep 17 00:00:00 2001 From: Martijn Scheepers Date: Mon, 7 Jun 2021 10:39:28 +0200 Subject: [PATCH] clear a few warnings --- README | 2 ++ include/global.h | 2 +- src/asyncWebserver.cpp | 2 +- src/h1602_eeprom.cpp | 2 +- src/main.cpp | 6 +++--- src/prtg.cpp | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..4b7093f --- /dev/null +++ b/README @@ -0,0 +1,2 @@ +Clear eeprom in platformIO +pio run -t erase \ No newline at end of file diff --git a/include/global.h b/include/global.h index 6ab827f..bf3e37a 100644 --- a/include/global.h +++ b/include/global.h @@ -1,7 +1,7 @@ #ifndef H1602_WSEN_GLOBAL_H #define H1602_WSEN_GLOBAL_H -//#define DEBUG_MSG +#define DEBUG_MSG #define INPUT_CHANNELS 5 diff --git a/src/asyncWebserver.cpp b/src/asyncWebserver.cpp index 3e831e9..ca959b7 100644 --- a/src/asyncWebserver.cpp +++ b/src/asyncWebserver.cpp @@ -426,7 +426,7 @@ void WifiScanGet(AsyncWebServerRequest *request) //Scan not triggered WiFi.scanNetworks(true, showHidden); } - else if (n) + else { for (int i = 0; i < n; ++i) { diff --git a/src/h1602_eeprom.cpp b/src/h1602_eeprom.cpp index 7b52bee..8676022 100644 --- a/src/h1602_eeprom.cpp +++ b/src/h1602_eeprom.cpp @@ -148,7 +148,7 @@ void checkEeprom() yield(); - if (writeCheck == true) + if (writeCheck) { EEPROM.put(EEPROMSTRUCT_OFFSET, eepromStruct); EEPROM.commit(); diff --git a/src/main.cpp b/src/main.cpp index 19706a6..1c9cfd1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -183,16 +183,16 @@ void setup() { pinMode(inputTable[i], INPUT_PULLUP); inputValue[i] = !digitalRead(inputTable[i]); - if (getEeprom()->apMode == false) + if (!getEeprom()->apMode) { - if (getEeprom()->channel[i].enable == true) + if (getEeprom()->channel[i].enable) { attachInputInterrupt(i); } } } - if (getEeprom()->apMode == true) + if (getEeprom()->apMode) { accessPointMode(); } diff --git a/src/prtg.cpp b/src/prtg.cpp index ba06610..df9ef68 100644 --- a/src/prtg.cpp +++ b/src/prtg.cpp @@ -21,7 +21,7 @@ void prtgServerUpdate() for (int i = 1; i < INPUT_CHANNELS; i++) { - if (getEepromChannel(i)->enable == true) + if (getEepromChannel(i)->enable) { request += F(""); request += getEepromChannel(i)->channel; @@ -45,7 +45,7 @@ void prtgServerUpdate() Serial.println(url); #endif - if (http.begin(httpClient, url) == false) + if (!http.begin(httpClient, url)) { #ifdef DEBUG_MSG Serial.println(F("http.begin failed"));