diff --git a/platformio.ini b/platformio.ini index 057ac93..4b308fb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -26,6 +26,8 @@ build_unflags = build_flags = -std=gnu++17 -O3 + -Werror + -Wall -DUSER_SETUP_LOADED=1 -DLOAD_GLCD=1 -DLOAD_FONT2=1 diff --git a/src/bmsutils.h b/src/bmsutils.h index 4d657f6..aa6421f 100644 --- a/src/bmsutils.h +++ b/src/bmsutils.h @@ -31,7 +31,7 @@ bool send6Bit(int zhen_tou, int address, int data) const auto sent = bluetoothSerial.write(buffer, 6); if (sent != 6) - Serial.printf("send: %lu\r\n", sent); + Serial.printf("send: %u\r\n", sent); return sent == 6; } @@ -53,7 +53,7 @@ void update() const auto read = bluetoothSerial.readBytes(buffer, 140); if (read != 140) { - Serial.printf("bms read buffer too short %lu\r\n", read); + Serial.printf("bms read buffer too short %u\r\n", read); for (int i = 0; i < read; i++) Serial.printf("%i ", buffer[i]); diff --git a/src/displays/starfielddisplay.h b/src/displays/starfielddisplay.h index b996e07..a37c678 100644 --- a/src/displays/starfielddisplay.h +++ b/src/displays/starfielddisplay.h @@ -105,7 +105,7 @@ uint8_t StarfieldDisplay::rng() zx++; za = (za^zc^zx); zb = (zb+za); - zc = (zc+(zb>>1)^za); + zc = (zc+(zb>>1))^za; return zc; } } diff --git a/src/webserver.h b/src/webserver.h index f9116c3..ca01466 100644 --- a/src/webserver.h +++ b/src/webserver.h @@ -59,13 +59,13 @@ void initWebserver() if (auto constCurrentDisplay = static_cast(currentDisplay)) { - if (const auto *textInterface = currentDisplay->asTextInterface()) + if (const auto *textInterface = constCurrentDisplay->asTextInterface()) { HtmlTag h2Tag{"h2", content}; content += textInterface->text(); } - if (const auto *menuDisplay = currentDisplay->asMenuDisplay()) + if (const auto *menuDisplay = constCurrentDisplay->asMenuDisplay()) { HtmlTag ulTag{"ul", content}; @@ -81,7 +81,7 @@ void initWebserver() i++; }); } - else if (const auto *changeValueDisplay = currentDisplay->asChangeValueDisplayInterface()) + else if (const auto *changeValueDisplay = constCurrentDisplay->asChangeValueDisplayInterface()) { content += "
"; content += "shownValue()} + "\" />"; diff --git a/src/widgets/graph.h b/src/widgets/graph.h index 6c58a91..8c816bc 100644 --- a/src/widgets/graph.h +++ b/src/widgets/graph.h @@ -74,7 +74,7 @@ void Graph::redraw(const std::array void Graph::render(const std::array>, COUNT> &buffers, bool delta) { - float min, max; + float min{std::numeric_limits::quiet_NaN()}, max{std::numeric_limits::quiet_NaN()}; bool first{true}; for (const ring_buffer &buffer : buffers) {