From 5e7b372345cabdae870e32c5881819fcf64d9880 Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Sat, 7 May 2022 20:36:15 +1000 Subject: [PATCH] Satisfy cppcheck --- src/graphics/Screen.cpp | 4 +--- src/mesh/Channels.cpp | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 6a9e37671..340feb912 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1518,9 +1518,7 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat auto mode = ""; - Config_LoRaConfig &loraConfig = config.payloadVariant.lora; - - switch (loraConfig.modem_preset) { + switch (config.payloadVariant.lora.modem_preset) { case Config_LoRaConfig_ModemPreset_ShortSlow: mode = "ShortSlow"; break; diff --git a/src/mesh/Channels.cpp b/src/mesh/Channels.cpp index 2edcf19b4..291145a8a 100644 --- a/src/mesh/Channels.cpp +++ b/src/mesh/Channels.cpp @@ -203,7 +203,6 @@ void Channels::setChannel(const Channel &c) const char *Channels::getName(size_t chIndex) { - Config_LoRaConfig &loraConfig = config.payloadVariant.lora; // Convert the short "" representation for Default into a usable string const ChannelSettings &channelSettings = getByIndex(chIndex).settings; const char *channelName = channelSettings.name; @@ -211,10 +210,10 @@ const char *Channels::getName(size_t chIndex) // Per mesh.proto spec, if bandwidth is specified we must ignore modemPreset enum, we assume that in that case // the app fucked up and forgot to set channelSettings.name - if (loraConfig.bandwidth != 0) + if (config.payloadVariant.lora.bandwidth != 0) channelName = "Unset"; else - switch (loraConfig.modem_preset) { + switch (config.payloadVariant.lora.modem_preset) { case Config_LoRaConfig_ModemPreset_ShortSlow: channelName = "ShortSlow"; break;