From 44f90a20b4e26928cf3377ce6a48bb0f39e47d83 Mon Sep 17 00:00:00 2001 From: OneOfEleven Date: Mon, 9 Oct 2023 23:13:34 +0100 Subject: [PATCH] Added brickies editings, fixed a couple of warnings. --- Makefile | 7 +++++-- app/app.c | 2 +- firmware.bin | Bin 60344 -> 60344 bytes firmware.packed.bin | Bin 60362 -> 60362 bytes functions.h | 4 ++-- misc.h | 6 ++++-- radio.c | 2 +- radio.h | 4 ++-- ui/scanner.c | 13 ++++++++++++- 9 files changed, 27 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index ed382ba..a19ffb5 100644 --- a/Makefile +++ b/Makefile @@ -200,6 +200,7 @@ ifeq ($(ENABLE_OVERLAY),1) endif CFLAGS = + ifeq ($(ENABLE_CLANG),0) CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD #CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c99 -MMD @@ -207,7 +208,8 @@ ifeq ($(ENABLE_CLANG),0) #CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=gnu11 -MMD else # Oz needed to make it fit on flash - CFLAGS += -Oz -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD + #CFLAGS += -Oz -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD + CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -std=c11 -MMD endif ifeq ($(ENABLE_LTO),1) @@ -221,7 +223,8 @@ endif #CFLAGS += -Wpadded # catch any and all warnings -#CFLAGS += -Wextra +# better to bust than add new bugs +CFLAGS += -Wextra CFLAGS += -DPRINTF_INCLUDE_CONFIG_H CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\" diff --git a/app/app.c b/app/app.c index af5e17c..65a078b 100644 --- a/app/app.c +++ b/app/app.c @@ -747,7 +747,7 @@ static void USER_NextChannel(void) #ifdef ENABLE_NOAA static void NOAA_IncreaseChannel(void) { - if (++g_noaa_channel > 9) + if (++g_noaa_channel >= ARRAY_SIZE(NoaaFrequencyTable)) g_noaa_channel = 0; } #endif diff --git a/firmware.bin b/firmware.bin index 41e56a7a4115e9dca541b33c746204dccd78d38f..9eea6fd1a2b1a4d72279bebce5f8ec5ade1ae606 100644 GIT binary patch delta 54 zcmdmSoq5M~<_!ntF$zvTI4>7S>d#kZ6x1z;GCUL{<8r9 DTRs&z delta 54 zcmdmSoq5M~<_!ntF$zpRI4>7S>d#kZ6xbX*|Bw-TTB^Bus+rMdnM>1z;GCUL{<8r9 DVpn8SXt@~vkf4_egO-U(VlGq@RL8EBLS= USER_CHANNEL_FIRST && (x) <= USER_CHANNEL_LAST) +//#define IS_USER_CHANNEL(x) ((x) >= USER_CHANNEL_FIRST && (x) <= USER_CHANNEL_LAST) +#define IS_USER_CHANNEL(x) ((x) <= USER_CHANNEL_LAST) #define IS_FREQ_CHANNEL(x) ((x) >= FREQ_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST) #define IS_VALID_CHANNEL(x) ((x) < LAST_CHANNEL) #define IS_NOAA_CHANNEL(x) ((x) >= NOAA_CHANNEL_FIRST && (x) <= NOAA_CHANNEL_LAST) -#define IS_NOT_NOAA_CHANNEL(x) ((x) >= USER_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST) +//#define IS_NOT_NOAA_CHANNEL(x) ((x) >= USER_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST) +#define IS_NOT_NOAA_CHANNEL(x) ((x) <= FREQ_CHANNEL_LAST) // PTT key-up/key-down audio tone freq's used in NASA's apollo rides to the moon #define APOLLO_TONE_MS 200 // slightly shorter tone length diff --git a/radio.c b/radio.c index 2840f43..217fcb7 100644 --- a/radio.c +++ b/radio.c @@ -178,7 +178,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure if (Channel <= USER_CHANNEL_LAST) { - Channel = RADIO_FindNextChannel(Channel, RADIO_CHANNEL_UP, false, VFO); + Channel = RADIO_FindNextChannel(Channel, SCAN_FWD, false, VFO); if (Channel == 0xFF) { Channel = g_eeprom.freq_channel[VFO]; diff --git a/radio.h b/radio.h index ce55344..6637517 100644 --- a/radio.h +++ b/radio.h @@ -30,12 +30,12 @@ enum { USER_CH_SCANLIST2 = 1u << 6, USER_CH_SCANLIST1 = 1u << 7 }; - +/* enum { RADIO_CHANNEL_UP = 0x01u, RADIO_CHANNEL_DOWN = 0xFFu, }; - +*/ enum { BANDWIDTH_WIDE = 0, BANDWIDTH_NARROW diff --git a/ui/scanner.c b/ui/scanner.c index d673242..57c12ed 100644 --- a/ui/scanner.c +++ b/ui/scanner.c @@ -30,7 +30,7 @@ void UI_DisplayScanner(void) { - char String[16]; + char String[17]; bool text_centered = false; if (g_screen_to_display != DISPLAY_SCANNER) @@ -42,6 +42,9 @@ void UI_DisplayScanner(void) // *********************************** // frequency text line + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (g_scan_css_state) { default: @@ -66,6 +69,8 @@ void UI_DisplayScanner(void) break; } + #pragma GCC diagnostic pop + UI_PrintString(String, 2, 0, 1, 8); // *********************************** @@ -120,6 +125,9 @@ void UI_DisplayScanner(void) default: case SCAN_EDIT_STATE_NONE: + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough=" + switch (g_scan_css_state) { default: @@ -148,6 +156,9 @@ void UI_DisplayScanner(void) text_centered = true; break; } + + #pragma GCC diagnostic pop + break; case SCAN_EDIT_STATE_BUSY: