From f47bd7d8256c3d346e915a94aa3a5430d6396353 Mon Sep 17 00:00:00 2001 From: reppad Date: Tue, 27 Feb 2024 22:22:52 +0100 Subject: [PATCH] Display scanlists membership instead of empty grid when radio not RX/TX --- Makefile | 5 +++++ README.md | 1 + ui/helper.c | 18 ++++++++++++++++++ ui/helper.h | 3 +++ ui/vfo.c | 11 +++++++++-- 5 files changed, 36 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 86eb8dd2..d9a022e5 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,8 @@ ENABLE_REGISTER_EDIT ?= 0 ENABLE_LTO ?= 0 ENABLE_OPTIMIZED ?= 1 ENABLE_SLOWER_RSSI_TIMER ?= 1 +# Scanlist membership display - 164 B +ENABLE_SCANLIST_DISPLAY ?= 1 OBJS = # Startup files @@ -223,6 +225,9 @@ endif ifeq ($(ENABLE_SLOWER_RSSI_TIMER), 1) CFLAGS += -DENABLE_SLOWER_RSSI_TIMER endif +ifeq ($(ENABLE_SCANLIST_DISPLAY), 1) + CFLAGS += -DENABLE_SCANLIST_DISPLAY +endif all: $(TARGET) $(OBJCOPY) -O binary $< $<.bin diff --git a/README.md b/README.md index 90f46856..975ed3e2 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,7 @@ ENABLE_FM_RADIO => FM broadcast radio mode ENABLE_LTO => Link Time Optimization ENABLE_OPTIMIZED => Compiler options to reduce binary size ENABLE_SLOWER_RSSI_TIMER => Slower update rate of RSSI to reduce screen updates that cause reports of clicking around 444-446MHz +ENABLE_SCANLIST_DISPLAY => Display scanlists membership instead of empty RSSI grid in channel mode when radio not RX/TX ``` ### Build & Flash diff --git a/ui/helper.c b/ui/helper.c index fda740d2..8963e930 100644 --- a/ui/helper.c +++ b/ui/helper.c @@ -384,6 +384,9 @@ void UI_DrawVoltage(uint8_t Vfo) void UI_DrawVfoFrame(uint8_t Y) { Y = 43 - (Y * 41); +#ifdef ENABLE_SCANLIST_DISPLAY + DISPLAY_Fill(20, 120, Y, Y + 6, COLOR_BACKGROUND); +#endif // Full size // DISPLAY_DrawRectangle0( 20, Y, 100, 1, COLOR_FOREGROUND); // DISPLAY_DrawRectangle1( 20, Y, 6, 1, COLOR_FOREGROUND); @@ -822,9 +825,11 @@ void UI_DrawSomething(void) } } UI_DrawRX(gCurrentVfo); +#ifndef ENABLE_SCANLIST_DISPLAY UI_DrawBar(0, gCurrentVfo); ConvertRssiToDbm(0); UI_DrawRxDBM(gCurrentVfo, true); +#endif UI_DrawRxSmeter(!gCurrentVfo, true); } UI_DrawMainBitmap(true, gSettings.CurrentVfo); @@ -1074,3 +1079,16 @@ void UI_DrawScan(void) } } } + +#ifdef ENABLE_SCANLIST_DISPLAY +void UI_DrawScanLists(uint8_t Vfo) +{ + uint8_t Y = 43 - (Vfo * 41); + gColorForeground = COLOR_GREY; + DISPLAY_Fill(20, 127, Y, Y + 6, COLOR_BACKGROUND); + for (uint8_t i = 0; i < 8; i++) { + gShortString[0] = (((gVfoState[Vfo].IsInscanList >> i) & 1 ) ? (49 + i) : '-'); + UI_DrawSmallString(26 + (i * 12), Y, gShortString, 1); + } +} +#endif diff --git a/ui/helper.h b/ui/helper.h index f393f1ab..fc6874e2 100644 --- a/ui/helper.h +++ b/ui/helper.h @@ -80,6 +80,9 @@ void UI_DrawDTMFString(void); void UI_DrawMuteInfo(bool bIs24Bit, uint32_t Golay); void UI_DrawNone(void); void UI_DrawScan(void); +#ifdef ENABLE_SCANLIST_DISPLAY +void UI_DrawScanLists(uint8_t Vfo); +#endif #endif diff --git a/ui/vfo.c b/ui/vfo.c index a5b1e2e7..eb412442 100644 --- a/ui/vfo.c +++ b/ui/vfo.c @@ -35,10 +35,17 @@ static void DrawBandwidth(bool bIsNarrow, uint8_t Vfo) void UI_DrawVfo(uint8_t Vfo) { - // TODO display enabled scan list, maybe using grid or dots UI_DrawName(Vfo, gVfoState[Vfo].Name); gColorForeground = COLOR_FOREGROUND; - UI_DrawVfoFrame(Vfo); +#ifdef ENABLE_SCANLIST_DISPLAY + if (gSettings.WorkMode && gRadioMode == RADIO_MODE_QUIET) { + UI_DrawScanLists(Vfo); + } else { +#endif + UI_DrawVfoFrame(Vfo); +#ifdef ENABLE_SCANLIST_DISPLAY + } +#endif if (Vfo == gCurrentVfo) { if (gRadioMode == RADIO_MODE_RX) {