From bf90961944291d332b81f29496ccb23bdd7c57c9 Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Mon, 12 Aug 2024 19:43:12 +0200 Subject: [PATCH] Save 88 bytes --- app/spectrum.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/app/spectrum.c b/app/spectrum.c index 2066c99..0896c76 100644 --- a/app/spectrum.c +++ b/app/spectrum.c @@ -789,32 +789,19 @@ static void DrawStatus() { #ifdef ENABLE_FEAT_F4HWN_SPECTRUM static void ShowChannelName(uint32_t f) { unsigned int i; - char s[12]; memset(String, 0, sizeof(String)); if ( isListening ) { for (i = 0; IS_MR_CHANNEL(i); i++) { - if (RADIO_CheckValidChannel(i, false, 0)) { - if (SETTINGS_FetchChannelFrequency(i) == f) { - memset(s, 0, sizeof(s)); - SETTINGS_FetchChannelName(s, i); - if (s[0] != 0) { - if ( strlen(String) != 0 ) - strcat(String, "/"); // Add a space to result - strcat(String, s); - } - break; - } + if (RADIO_CheckValidChannel(i, false, 0)) { + if (SETTINGS_FetchChannelFrequency(i) == f) { + SETTINGS_FetchChannelName(String, i); + UI_PrintStringSmallBold(String[0] ? String : "--", 8, 127, 1); + break; } + } } } - - if (String[0] != 0) { - if ( strlen(String) > 19 ) { - String[19] = 0; - } - UI_PrintStringSmallBold(String, 8, 127, 1); - } } #endif