0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00

Added brickies editings, fixed a couple of warnings.

This commit is contained in:
OneOfEleven 2023-10-09 23:13:34 +01:00
parent c76891be6d
commit 44f90a20b4
9 changed files with 27 additions and 11 deletions

View File

@ -200,6 +200,7 @@ ifeq ($(ENABLE_OVERLAY),1)
endif endif
CFLAGS = CFLAGS =
ifeq ($(ENABLE_CLANG),0) 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=c11 -MMD
#CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c99 -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 #CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=gnu11 -MMD
else else
# Oz needed to make it fit on flash # 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 endif
ifeq ($(ENABLE_LTO),1) ifeq ($(ENABLE_LTO),1)
@ -221,7 +223,8 @@ endif
#CFLAGS += -Wpadded #CFLAGS += -Wpadded
# catch any and all warnings # catch any and all warnings
#CFLAGS += -Wextra # better to bust than add new bugs
CFLAGS += -Wextra
CFLAGS += -DPRINTF_INCLUDE_CONFIG_H CFLAGS += -DPRINTF_INCLUDE_CONFIG_H
CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\" CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\"

View File

@ -747,7 +747,7 @@ static void USER_NextChannel(void)
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
static void NOAA_IncreaseChannel(void) static void NOAA_IncreaseChannel(void)
{ {
if (++g_noaa_channel > 9) if (++g_noaa_channel >= ARRAY_SIZE(NoaaFrequencyTable))
g_noaa_channel = 0; g_noaa_channel = 0;
} }
#endif #endif

Binary file not shown.

Binary file not shown.

View File

@ -21,7 +21,7 @@
enum function_type_e enum function_type_e
{ {
FUNCTION_FOREGROUND = 0, // ??? FUNCTION_FOREGROUND = 0, // idle (not in power save)
FUNCTION_TRANSMIT, // transmitting FUNCTION_TRANSMIT, // transmitting
FUNCTION_MONITOR, // receiving with squelch forced open FUNCTION_MONITOR, // receiving with squelch forced open
FUNCTION_INCOMING, // receiving a signal (squelch is open) FUNCTION_INCOMING, // receiving a signal (squelch is open)
@ -31,7 +31,7 @@ enum function_type_e
}; };
typedef enum function_type_e function_type_t; typedef enum function_type_e function_type_t;
extern function_type_t g_current_function; extern function_type_t g_current_function;
void FUNCTION_Init(void); void FUNCTION_Init(void);
void FUNCTION_Select(function_type_t Function); void FUNCTION_Select(function_type_t Function);

6
misc.h
View File

@ -32,12 +32,14 @@
#define MIN(a, b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; }) #define MIN(a, b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
#endif #endif
#define IS_USER_CHANNEL(x) ((x) >= 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_FREQ_CHANNEL(x) ((x) >= FREQ_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST)
#define IS_VALID_CHANNEL(x) ((x) < LAST_CHANNEL) #define IS_VALID_CHANNEL(x) ((x) < LAST_CHANNEL)
#define IS_NOAA_CHANNEL(x) ((x) >= NOAA_CHANNEL_FIRST && (x) <= NOAA_CHANNEL_LAST) #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 // 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 #define APOLLO_TONE_MS 200 // slightly shorter tone length

View File

@ -178,7 +178,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
if (Channel <= USER_CHANNEL_LAST) 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) if (Channel == 0xFF)
{ {
Channel = g_eeprom.freq_channel[VFO]; Channel = g_eeprom.freq_channel[VFO];

View File

@ -30,12 +30,12 @@ enum {
USER_CH_SCANLIST2 = 1u << 6, USER_CH_SCANLIST2 = 1u << 6,
USER_CH_SCANLIST1 = 1u << 7 USER_CH_SCANLIST1 = 1u << 7
}; };
/*
enum { enum {
RADIO_CHANNEL_UP = 0x01u, RADIO_CHANNEL_UP = 0x01u,
RADIO_CHANNEL_DOWN = 0xFFu, RADIO_CHANNEL_DOWN = 0xFFu,
}; };
*/
enum { enum {
BANDWIDTH_WIDE = 0, BANDWIDTH_WIDE = 0,
BANDWIDTH_NARROW BANDWIDTH_NARROW

View File

@ -30,7 +30,7 @@
void UI_DisplayScanner(void) void UI_DisplayScanner(void)
{ {
char String[16]; char String[17];
bool text_centered = false; bool text_centered = false;
if (g_screen_to_display != DISPLAY_SCANNER) if (g_screen_to_display != DISPLAY_SCANNER)
@ -42,6 +42,9 @@ void UI_DisplayScanner(void)
// *********************************** // ***********************************
// frequency text line // frequency text line
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
switch (g_scan_css_state) switch (g_scan_css_state)
{ {
default: default:
@ -66,6 +69,8 @@ void UI_DisplayScanner(void)
break; break;
} }
#pragma GCC diagnostic pop
UI_PrintString(String, 2, 0, 1, 8); UI_PrintString(String, 2, 0, 1, 8);
// *********************************** // ***********************************
@ -120,6 +125,9 @@ void UI_DisplayScanner(void)
default: default:
case SCAN_EDIT_STATE_NONE: case SCAN_EDIT_STATE_NONE:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
switch (g_scan_css_state) switch (g_scan_css_state)
{ {
default: default:
@ -148,6 +156,9 @@ void UI_DisplayScanner(void)
text_centered = true; text_centered = true;
break; break;
} }
#pragma GCC diagnostic pop
break; break;
case SCAN_EDIT_STATE_BUSY: case SCAN_EDIT_STATE_BUSY: