Save 88 bytes

This commit is contained in:
Armel FAUVEAU
2024-08-12 19:43:12 +02:00
parent f98480175e
commit bf90961944

View File

@@ -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