From a4875c234ff8acff50e3140c87d51dd3d7049615 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 24 Jan 2026 05:23:32 -0600 Subject: [PATCH] Fix warnings --- src/mesh/RadioInterface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index f2ee0defe..26ef162b9 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -231,17 +231,17 @@ void RadioInterface::bootstrapLoRaConfigFromPreset(meshtastic_Config_LoRaConfig for (; r->code != meshtastic_Config_LoRaConfig_RegionCode_UNSET && r->code != loraConfig.region; r++) ; - const bool wideLora = r ? r->wideLora : false; + const bool regionWideLora = r->wideLora; float bwKHz = 0; uint8_t sf = 0; uint8_t cr = 0; - modemPresetToParams(loraConfig.modem_preset, wideLora, bwKHz, sf, cr); + modemPresetToParams(loraConfig.modem_preset, regionWideLora, bwKHz, sf, cr); // If selected preset requests a bandwidth larger than the region span, fall back to LONG_FAST. - if (r && (r->freqEnd - r->freqStart) < (bwKHz / 1000.0f)) { + if (r->code != meshtastic_Config_LoRaConfig_RegionCode_UNSET && (r->freqEnd - r->freqStart) < (bwKHz / 1000.0f)) { loraConfig.modem_preset = meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST; - modemPresetToParams(loraConfig.modem_preset, wideLora, bwKHz, sf, cr); + modemPresetToParams(loraConfig.modem_preset, regionWideLora, bwKHz, sf, cr); } loraConfig.bandwidth = bwKHzToCode(bwKHz);