From 38d20684e1c71691aa2bd0247c805f5aac42a264 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 16 Jul 2026 23:30:24 +0200 Subject: [PATCH 01/10] aes-ccm: drop meaningless volatile qualifier on cast result --- src/mesh/aes-ccm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh/aes-ccm.cpp b/src/mesh/aes-ccm.cpp index 5ed7ff92838..776fe87717d 100644 --- a/src/mesh/aes-ccm.cpp +++ b/src/mesh/aes-ccm.cpp @@ -21,8 +21,8 @@ static int constant_time_compare(const void *a_, const void *b_, size_t len) { /* Cast to volatile to prevent the compiler from optimizing out their comparison. */ - const volatile uint8_t *volatile a = (const volatile uint8_t *volatile)a_; - const volatile uint8_t *volatile b = (const volatile uint8_t *volatile)b_; + const volatile uint8_t *volatile a = (const volatile uint8_t *)a_; + const volatile uint8_t *volatile b = (const volatile uint8_t *)b_; if (len == 0) return 0; if (a == NULL || b == NULL) From 75f5f9f6892308d76355aaa754cc40c654538ea4 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 16 Jul 2026 23:30:53 +0200 Subject: [PATCH 02/10] GPS: mark intentional case fall-through in active-probe switch --- src/gps/GPS.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 430030422b2..5cc2c9f8312 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -719,12 +719,15 @@ bool GPS::verifyCachedProbePresence() break; case GNSS_MODEL_MTK_L76B: cachedProbeModelName = "L76B"; + [[fallthrough]]; case GNSS_MODEL_MTK_PA1010D: if (cachedProbeModel == GNSS_MODEL_MTK_PA1010D) cachedProbeModelName = "PA1010D"; + [[fallthrough]]; case GNSS_MODEL_MTK_PA1616S: if (cachedProbeModel == GNSS_MODEL_MTK_PA1616S) cachedProbeModelName = "PA1616S"; + [[fallthrough]]; case GNSS_MODEL_LS20031: if (cachedProbeModel == GNSS_MODEL_LS20031) cachedProbeModelName = "LS20031"; @@ -733,6 +736,7 @@ bool GPS::verifyCachedProbePresence() break; case GNSS_MODEL_AG3335: cachedProbeModelName = "AG3335"; + [[fallthrough]]; case GNSS_MODEL_AG3352: if (cachedProbeModel == GNSS_MODEL_AG3352) cachedProbeModelName = "AG3352"; From 29905d6467988fdfb89e223c31ec44be1331c4ac Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 16 Jul 2026 23:31:12 +0200 Subject: [PATCH 03/10] ScanI2C: mark intentional fall-through to default probe --- src/detect/ScanI2CTwoWire.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 151e559f15b..24da97223a2 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -416,6 +416,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) if (type == DPS310 || type == SPA06) { break; } + [[fallthrough]]; default: registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1); // GET_ID switch (registerValue) { From e1d2c4c20e71d9b865b0cb02ac17533f7c9f9dd3 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 16 Jul 2026 23:32:07 +0200 Subject: [PATCH 04/10] SharedUIDisplay: silence unused-var warnings on monochrome builds These header-color and battery-fill-region locals are only consumed inside #if GRAPHICS_TFT_COLORING_ENABLED blocks, so they are unused on monochrome targets (e.g. heltec-v3). Mark them [[maybe_unused]]. --- src/graphics/SharedUIDisplay.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/graphics/SharedUIDisplay.cpp b/src/graphics/SharedUIDisplay.cpp index e60fe612835..d045adaf87d 100644 --- a/src/graphics/SharedUIDisplay.cpp +++ b/src/graphics/SharedUIDisplay.cpp @@ -118,7 +118,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti const int screenW = display->getWidth(); const int screenH = display->getHeight(); const int headerHeight = highlightHeight + 2; - const uint16_t headerColorForRoles = getThemeHeaderBg(); + [[maybe_unused]] const uint16_t headerColorForRoles = getThemeHeaderBg(); // Color TFT headers use a fixed dark background + white glyphs. // Keep legacy inverted bitmap behavior only for monochrome displays. const bool useInvertedHeaderStyle = (isInverted && !force_no_invert && !isTFTColoringEnabled() && !transparent_background); @@ -131,10 +131,11 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti #endif { - const uint16_t headerColor = getThemeHeaderBg(); + [[maybe_unused]] const uint16_t headerColor = getThemeHeaderBg(); const uint16_t headerTextColor = getThemeHeaderText(); - const uint16_t headerTitleColorForRole = use_title_color_override ? title_color_override : headerTextColor; - uint16_t headerStatusColor = getThemeHeaderStatus(); + [[maybe_unused]] const uint16_t headerTitleColorForRole = + use_title_color_override ? title_color_override : headerTextColor; + [[maybe_unused]] uint16_t headerStatusColor = getThemeHeaderStatus(); #if GRAPHICS_TFT_COLORING_ENABLED // Clock frame uses transparent header + date + empty title. // For accent clock themes (Pink/Creamsicle + classic monochrome), tint @@ -232,11 +233,11 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti bool useHorizontalBattery = (currentResolution == ScreenResolution::High && screenW >= screenH); const int textY = y + (highlightHeight - FONT_HEIGHT_SMALL) / 2; - bool hasBatteryFillRegion = false; - int16_t batteryFillRegionX = 0; - int16_t batteryFillRegionY = 0; - int16_t batteryFillRegionW = 0; - int16_t batteryFillRegionH = 0; + [[maybe_unused]] bool hasBatteryFillRegion = false; + [[maybe_unused]] int16_t batteryFillRegionX = 0; + [[maybe_unused]] int16_t batteryFillRegionY = 0; + [[maybe_unused]] int16_t batteryFillRegionW = 0; + [[maybe_unused]] int16_t batteryFillRegionH = 0; #if GRAPHICS_TFT_COLORING_ENABLED uint16_t batteryFillColor = getThemeBatteryFillColor(chargePercent); if (useClockHeaderAccent) { @@ -316,7 +317,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti char chargeStr[4]; snprintf(chargeStr, sizeof(chargeStr), "%d", chargePercent); int chargeNumWidth = display->getStringWidth(chargeStr); - const int percentWidth = display->getStringWidth("%"); + [[maybe_unused]] const int percentWidth = display->getStringWidth("%"); const int percentX = batteryX + chargeNumWidth - 1; display->drawString(batteryX, textY, chargeStr); display->drawString(percentX, textY, "%"); @@ -569,8 +570,8 @@ void drawCommonFooter(OLEDDisplay *display, int16_t x, int16_t y) const int footerH = (connection_icon_height * scale) + (2 * scale); const int iconX = 0; const int iconY = SCREEN_HEIGHT - (connection_icon_height * scale); - const int iconW = connection_icon_width * scale; - const int iconH = connection_icon_height * scale; + [[maybe_unused]] const int iconW = connection_icon_width * scale; + [[maybe_unused]] const int iconH = connection_icon_height * scale; #if GRAPHICS_TFT_COLORING_ENABLED // Only tint the link glyph itself on TFT; keep the footer background black. From 84a7f0ac2ea09b8fdee70ed3e80d840d254e1e3d Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 16 Jul 2026 23:33:13 +0200 Subject: [PATCH 05/10] UIRenderer: fix redundant array-address checks and unused vars --- src/graphics/draw/UIRenderer.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/graphics/draw/UIRenderer.cpp b/src/graphics/draw/UIRenderer.cpp index 2e2a35f1895..89d1f95df66 100644 --- a/src/graphics/draw/UIRenderer.cpp +++ b/src/graphics/draw/UIRenderer.cpp @@ -1206,7 +1206,7 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta // === Node Identity === int textWidth = 0; int nameX = 0; - const char *shortName = owner.short_name ? owner.short_name : ""; + const char *shortName = owner.short_name[0] ? owner.short_name : ""; // === ShortName Centered === textWidth = UIRenderer::measureStringWithEmotes(display, shortName); @@ -1249,7 +1249,7 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta if (!config.bluetooth.enabled) { extraoffset = (currentResolution == ScreenResolution::High) ? 6 : 1; } - const int raw_chutil_percent = chutil_percent; + [[maybe_unused]] const int raw_chutil_percent = chutil_percent; // With BT disabled we pin this row left to make room for the extra "BT off" indicator. const int starting_position = config.bluetooth.enabled ? x : 0; @@ -1295,7 +1295,7 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta int nameX = 0; int yOffset = (currentResolution == ScreenResolution::High) ? 0 : 5; const char *longName = (nodeInfoLiteHasUser(ourNode) && ourNode->long_name[0]) ? ourNode->long_name : ""; - const char *shortName = owner.short_name ? owner.short_name : ""; + const char *shortName = owner.short_name[0] ? owner.short_name : ""; char combinedName[96]; if (longName[0] && shortName[0]) { snprintf(combinedName, sizeof(combinedName), "%s (%s)", longName, shortName); @@ -1504,7 +1504,7 @@ void UIRenderer::drawIconScreen(const char *upperMsg, OLEDDisplay *display, OLED } // Draw version and short name in bottom middle char footer[64]; - if (owner.short_name && owner.short_name[0]) { + if (owner.short_name[0]) { snprintf(footer, sizeof(footer), "%s %s", xstr(APP_VERSION_SHORT), owner.short_name); } else { snprintf(footer, sizeof(footer), "%s", xstr(APP_VERSION_SHORT)); @@ -1547,7 +1547,7 @@ void UIRenderer::drawIconScreen(const char *upperMsg, OLEDDisplay *display, OLED if (gBootSplashBoldPass) { display->drawString(versionX + 1, y + 5, version); } - if (owner.short_name && owner.short_name[0]) { + if (owner.short_name[0]) { const char *shortName = owner.short_name; int shortNameW = UIRenderer::measureStringWithEmotes(display, shortName); int shortNameX = x + SCREEN_WIDTH - shortNameW - 5; @@ -1789,7 +1789,7 @@ void UIRenderer::drawOEMIconScreen(const char *upperMsg, OLEDDisplay *display, O const char *version = xstr(APP_VERSION_SHORT); int versionX = x + SCREEN_WIDTH - display->getStringWidth(version); display->drawString(versionX, y + 0, version); - if (owner.short_name && owner.short_name[0]) { + if (owner.short_name[0]) { const char *shortName = owner.short_name; int shortNameW = UIRenderer::measureStringWithEmotes(display, shortName); int shortNameX = x + SCREEN_WIDTH - shortNameW; @@ -1971,10 +1971,8 @@ void UIRenderer::drawNavigationBar(OLEDDisplay *display, OLEDDisplayUiState *sta // Right arrow if (navBarVisible && pageEnd < totalIcons) { - int baseX = rectX + rectWidth + offset; - int regionX = baseX; - #if GRAPHICS_TFT_COLORING_ENABLED + int regionX = rectX + rectWidth + offset; registerTFTColorRegion(TFTColorRole::NavigationArrow, regionX, top, maxW, halfH); #endif @@ -1983,10 +1981,8 @@ void UIRenderer::drawNavigationBar(OLEDDisplay *display, OLEDDisplayUiState *sta // Left arrow if (navBarVisible && pageStart > 0) { - int baseX = rectX - offset - 1; - int regionX = baseX - maxW + 1; - #if GRAPHICS_TFT_COLORING_ENABLED + int regionX = rectX - offset - 1 - maxW + 1; registerTFTColorRegion(TFTColorRole::NavigationArrow, regionX, top, maxW, halfH); #endif From 3928c1dc56be7c11205e4542ed5882c19d7eb7c8 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 16 Jul 2026 23:33:37 +0200 Subject: [PATCH 06/10] DebugRenderer: mark TFT-only raw_chutil_percent [[maybe_unused]] --- src/graphics/draw/DebugRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/draw/DebugRenderer.cpp b/src/graphics/draw/DebugRenderer.cpp index 243a62932e2..d8db4eedde1 100644 --- a/src/graphics/draw/DebugRenderer.cpp +++ b/src/graphics/draw/DebugRenderer.cpp @@ -466,7 +466,7 @@ void drawLoRaFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int chutil_bar_height = (currentResolution == ScreenResolution::High) ? 12 : 7; int extraoffset = (currentResolution == ScreenResolution::High) ? 6 : 3; int chutil_percent = airTime->channelUtilizationPercent(); - const int raw_chutil_percent = chutil_percent; + [[maybe_unused]] const int raw_chutil_percent = chutil_percent; int centerofscreen = SCREEN_WIDTH / 2; int total_line_content_width = (chUtil_x + chutil_bar_width + display->getStringWidth(chUtilPercentage) + extraoffset) / 2; From 9aa751b5201bc7ecefb2aac6902603f8fc6eef81 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 16 Jul 2026 23:34:04 +0200 Subject: [PATCH 07/10] NotificationRenderer: scope TFT-only maxBarHeight to its #if block --- src/graphics/draw/NotificationRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/draw/NotificationRenderer.cpp b/src/graphics/draw/NotificationRenderer.cpp index 03e53c3bd7c..bdeac36ca34 100644 --- a/src/graphics/draw/NotificationRenderer.cpp +++ b/src/graphics/draw/NotificationRenderer.cpp @@ -935,7 +935,6 @@ void NotificationRenderer::drawNotificationBox(OLEDDisplay *display, OLEDDisplay const int barSpacing = 2; const int barHeightStep = 2; const int gap = 6; - const int maxBarHeight = totalBars * barHeightStep; int textWidth = display->getStringWidth(lineBuffer, strlen(lineBuffer), true); int barsWidth = totalBars * barWidth + (totalBars - 1) * barSpacing + gap; @@ -960,6 +959,7 @@ void NotificationRenderer::drawNotificationBox(OLEDDisplay *display, OLEDDisplay } const int activeBars = min(graphics::bannerSignalBars, totalBars); const int regionWidth = activeBars * barWidth + (activeBars - 1) * barSpacing; + const int maxBarHeight = totalBars * barHeightStep; setAndRegisterTFTColorRole(TFTColorRole::SignalBars, signalBarsColor, TFTPalette::Black, baseX, baseY - maxBarHeight, regionWidth, maxBarHeight); } From bcf06ccbc817bd637471428eecc8a28fd53f48c2 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 16 Jul 2026 23:34:31 +0200 Subject: [PATCH 08/10] CannedMessage: fix redundant nodeName address check, unused textYOffset --- src/modules/CannedMessageModule.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 7710660547b..709bda51336 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -2066,10 +2066,9 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st int rowHeight = getRowHeightForEmoteText(msg, baseRowSpacing); bool _highlight = (msgIdx == currentMessageIndex); +#ifdef USE_EINK // Vertically center based on rowHeight int textYOffset = (rowHeight - FONT_HEIGHT_SMALL) / 2; - -#ifdef USE_EINK int nextX = x + (_highlight ? 12 : 0); if (_highlight) display->drawString(x + 0, lineY + textYOffset, ">"); @@ -2244,19 +2243,19 @@ ProcessMessage CannedMessageModule::handleReceived(const meshtastic_MeshPacket & snprintf(buf, sizeof(buf), "Message sent to\n#%s\n\nSignal: %s", (channelName && channelName[0]) ? channelName : "unknown", qualityLabel); } else { - snprintf(buf, sizeof(buf), "DM sent to\n@%s\n\nSignal: %s", - (nodeName && nodeName[0]) ? nodeName : "unknown", qualityLabel); + snprintf(buf, sizeof(buf), "DM sent to\n@%s\n\nSignal: %s", nodeName[0] ? nodeName : "unknown", + qualityLabel); } } else if (isAck && !isFromDest) { // Relay ACK banner snprintf(buf, sizeof(buf), "DM Relayed\n(Status Unknown)\n%s\n\nSignal: %s", - (nodeName && nodeName[0]) ? nodeName : "unknown", qualityLabel); + nodeName[0] ? nodeName : "unknown", qualityLabel); } else { if (this->lastSentNode == NODENUM_BROADCAST) { snprintf(buf, sizeof(buf), "Message failed to\n#%s", (channelName && channelName[0]) ? channelName : "unknown"); } else { - snprintf(buf, sizeof(buf), "DM failed to\n@%s", (nodeName && nodeName[0]) ? nodeName : "unknown"); + snprintf(buf, sizeof(buf), "DM failed to\n@%s", nodeName[0] ? nodeName : "unknown"); } } From 315570c2d33dc83bec33004253904cd70bc808ba Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 16 Jul 2026 23:35:09 +0200 Subject: [PATCH 09/10] TrafficManagement: remove dead locals in maintenance sweep --- src/modules/TrafficManagementModule.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/modules/TrafficManagementModule.cpp b/src/modules/TrafficManagementModule.cpp index 89ad128ccf5..0183e648524 100644 --- a/src/modules/TrafficManagementModule.cpp +++ b/src/modules/TrafficManagementModule.cpp @@ -859,8 +859,6 @@ int32_t TrafficManagementModule::runOnce() return INT32_MAX; #if TRAFFIC_MANAGEMENT_CACHE_SIZE > 0 - const uint32_t nowMs = TrafficManagementModule::clockMs(); - // Warm-start the next-hop cache from persisted NodeInfoLite hints once nodeDB // is populated. Done here (not in the constructor) so nodeDB has finished // loading. Takes its own lock, so call before acquiring the sweep guard below. @@ -895,7 +893,6 @@ int32_t TrafficManagementModule::runOnce() uint16_t expiredEntries = 0; const uint32_t sweepStartMs = TrafficManagementModule::clockMs(); - const auto &cfg = moduleConfig.traffic_management; concurrency::LockGuard guard(&cacheLock); for (uint16_t i = 0; i < cacheSize(); i++) { From 659baeee9264807940ba8a514e3c374911b860c7 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 16 Jul 2026 23:36:15 +0200 Subject: [PATCH 10/10] NimbleBluetooth: migrate deprecated updateConnParams to requestConnParams --- src/nimble/NimbleBluetooth.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nimble/NimbleBluetooth.cpp b/src/nimble/NimbleBluetooth.cpp index 647c1bef88e..7d523bc4863 100644 --- a/src/nimble/NimbleBluetooth.cpp +++ b/src/nimble/NimbleBluetooth.cpp @@ -440,7 +440,7 @@ class BluetoothPhoneAPI : public PhoneAPI, public concurrency::OSThread setup. Not worth adjusting much. */ LOG_INFO("BLE requestHighThroughputConnection"); - bleServer->updateConnParams(conn_handle, 6, 12, 0, 600); + bleServer->requestConnParams(conn_handle, 6, 12, 0, 600); } void requestLowerPowerConnection(uint16_t conn_handle) @@ -463,7 +463,7 @@ class BluetoothPhoneAPI : public PhoneAPI, public concurrency::OSThread per second. */ LOG_INFO("BLE requestLowerPowerConnection"); - bleServer->updateConnParams(conn_handle, 24, 40, 2, 600); + bleServer->requestConnParams(conn_handle, 24, 40, 2, 600); } }; @@ -754,7 +754,7 @@ class NimbleBluetoothServerCallback : public BLEServerCallbacks #endif LOG_INFO("BLE conn %u peer MTU %u (target %u)", connHandle, pServer->getPeerMTU(connHandle), kPreferredBleMtu); - pServer->updateConnParams(connHandle, 6, 12, 0, 200); + pServer->requestConnParams(connHandle, 6, 12, 0, 200); } void onDisconnect(BLEServer *pServer, struct ble_gap_conn_desc *desc)