From 88141810cb5cbde3333045f9267d6b2a50912201 Mon Sep 17 00:00:00 2001 From: OneOfEleven Date: Mon, 6 Nov 2023 16:20:02 +0000 Subject: [PATCH] added compile option for showing a frequencies channel --- Makefile | 4 ++++ README.md | 1 + ui/main.c | 38 ++++++++++++++++++++------------------ 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 87a2c9d..7c865f6 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,7 @@ ENABLE_MDC1200_SIDE_BEEP := 1 ENABLE_PWRON_PASSWORD := 0 ENABLE_RESET_AES_KEY := 0 ENABLE_BIG_FREQ := 0 +ENABLE_SHOW_FREQS_CHAN := 1 # smaa bolf 580 B ENABLE_SMALL_BOLD := 1 # smallest font 2 kB @@ -325,6 +326,9 @@ endif ifeq ($(ENABLE_BIG_FREQ),1) CFLAGS += -DENABLE_BIG_FREQ endif +ifeq ($(ENABLE_SHOW_FREQS_CHAN),1) + CFLAGS += -DENABLE_SHOW_FREQS_CHAN +endif ifeq ($(ENABLE_SMALL_BOLD),1) CFLAGS += -DENABLE_SMALL_BOLD endif diff --git a/README.md b/README.md index f2340e0..fd77c8f 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ ENABLE_MDC1200_SIDE_BEEP := 1 enable short side tone/beep when MDC ENABLE_PWRON_PASSWORD := 0 include power-on password code ENABLE_RESET_AES_KEY := 1 '1' = reset/clear the AES key stored in the eeprom (only if it's set) ENABLE_BIG_FREQ := 0 big font frequencies (like original QS firmware) +ENABLE_SHOW_FREQS_CHAN := 1 show the channel name under the frequency if the frequency is found in a channel ENABLE_SMALL_BOLD := 1 bold channel name/no. (when name + freq channel display mode) ENABLE_TRIM_TRAILING_ZEROS := 1 trim away any trailing zeros on frequencies ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel diff --git a/ui/main.c b/ui/main.c index 332dda4..66bcc90 100644 --- a/ui/main.c +++ b/ui/main.c @@ -726,24 +726,26 @@ void UI_DisplayMain(void) NUMBER_trim_trailing_zeros(str); #endif - //g_vfo_info[vfo_num].freq_in_channel = SETTINGS_find_channel(frequency); - if (chan <= USER_CHANNEL_LAST) - { // the frequency has a channel - show the channel name below the frequency - - // frequency - #ifdef ENABLE_SMALL_BOLD - UI_PrintStringSmallBold(str, x + 4, 0, line + 0); - #else - UI_PrintStringSmall(str, x + 4, 0, line + 0); - #endif - - // name - SETTINGS_fetch_channel_name(str, chan); - if (str[0] == 0) - sprintf(str, "CH-%03u", 1 + chan); - UI_PrintStringSmall(str, x + 4, 0, line + 1); - } - else + #ifdef ENABLE_SHOW_FREQS_CHAN + //g_vfo_info[vfo_num].freq_in_channel = SETTINGS_find_channel(frequency); + if (chan <= USER_CHANNEL_LAST) + { // the frequency has a channel - show the channel name below the frequency + + // frequency + #ifdef ENABLE_SMALL_BOLD + UI_PrintStringSmallBold(str, x + 4, 0, line + 0); + #else + UI_PrintStringSmall(str, x + 4, 0, line + 0); + #endif + + // name + SETTINGS_fetch_channel_name(str, chan); + if (str[0] == 0) + sprintf(str, "CH-%03u", 1 + chan); + UI_PrintStringSmall(str, x + 4, 0, line + 1); + } + else + #endif { // show the frequency in the main font UI_PrintString(str, x, 0, line, 8); }