Skip to content

Commit

Permalink
Display scanlists membership instead of empty grid when radio not RX/TX
Browse files Browse the repository at this point in the history
  • Loading branch information
reppad committed Feb 28, 2024
1 parent 9e034ae commit f47bd7d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions ui/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions ui/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

11 changes: 9 additions & 2 deletions ui/vfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f47bd7d

Please sign in to comment.