diff --git a/Makefile b/Makefile index a19ffb5..84690bb 100644 --- a/Makefile +++ b/Makefile @@ -202,14 +202,11 @@ 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 - #CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=gnu99 -MMD - #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=c11 -MMD + CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -std=c11 -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 += -Os -Wall -Werror -mcpu=cortex-m0 -std=c11 -MMD + CFLAGS += -Oz -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD endif ifeq ($(ENABLE_LTO),1) diff --git a/app/app.c b/app/app.c index 52b6bcb..7f7dae3 100644 --- a/app/app.c +++ b/app/app.c @@ -1792,9 +1792,8 @@ void cancelUserInputModes(void) { DTMF_clear_input_box(); g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; - g_request_display_screen = DISPLAY_MAIN; - g_update_display = true; + g_update_display = true; } if (g_fkey_pressed || g_key_input_count_down > 0 || g_input_box_index > 0) @@ -1802,7 +1801,6 @@ void cancelUserInputModes(void) g_fkey_pressed = false; g_input_box_index = 0; g_key_input_count_down = 0; - g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; g_update_status = true; g_update_display = true; @@ -2331,7 +2329,6 @@ static void APP_ProcessKey(const key_code_t Key, const bool key_pressed, const b if (Key == KEY_PTT && g_ptt_was_pressed) { flag = key_held; - if (!key_pressed) { flag = true; @@ -2345,7 +2342,6 @@ static void APP_ProcessKey(const key_code_t Key, const bool key_pressed, const b { if (key_held) flag = true; - // if (!key_pressed) if (key_pressed) // I now use key released for button press detections { diff --git a/app/generic.c b/app/generic.c index 6f637ef..af082eb 100644 --- a/app/generic.c +++ b/app/generic.c @@ -25,6 +25,7 @@ #include "app/scanner.h" #include "audio.h" #include "driver/keyboard.h" +#include "driver/uart.h" #include "dtmf.h" #include "external/printf/printf.h" #include "functions.h" @@ -159,6 +160,10 @@ void GENERIC_Key_PTT(bool key_pressed) // PTT pressed + #if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG) +// UART_printf("gene key 1 %u\r\n", key_pressed); + #endif + if (g_scan_state_dir != SCAN_OFF || // frequency/channel scanning g_screen_to_display == DISPLAY_SCANNER || // CTCSS/CDCSS scanning g_css_scan_mode != CSS_SCAN_MODE_OFF) // " " diff --git a/app/main.c b/app/main.c index b09f4f2..f90f078 100644 --- a/app/main.c +++ b/app/main.c @@ -823,21 +823,19 @@ void MAIN_ProcessKeys(key_code_t Key, bool key_pressed, bool key_held) if (g_dtmf_input_mode) { - if (key_pressed && !key_held) - { - const char Character = DTMF_GetCharacter(Key); - if (Character != 0xFF) - { // add key to DTMF string - + const char Character = DTMF_GetCharacter(Key); + if (Character != 0xFF) + { // add key to DTMF string + if (key_pressed && !key_held) + { DTMF_Append(Character); - g_key_input_count_down = key_input_timeout_500ms; -// g_ptt_was_released = true; // why is this being set ? + //g_ptt_was_released = true; // why is this being set ? g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; g_request_display_screen = DISPLAY_MAIN; } + return; } - return; } switch (Key) diff --git a/firmware.bin b/firmware.bin index 5700e8a..5862d15 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 1779500..2db7c10 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/ui/battery.c b/ui/battery.c index 4c5a672..52a09c2 100644 --- a/ui/battery.c +++ b/ui/battery.c @@ -45,7 +45,7 @@ void UI_DrawBattery(uint8_t *bitmap, const unsigned int level, const unsigned in } else if (blink == 0) - memset(bitmap, 0, sizeof(bitmap)); + memset(bitmap, 0, sizeof(BITMAP_BATTERY_LEVEL)); } void UI_DisplayBattery(const unsigned int level, const unsigned int blink) diff --git a/ui/menu.c b/ui/menu.c index 4515c96..9ca3b03 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -539,7 +539,7 @@ void UI_DisplayMenu(void) #endif case MENU_STEP: - sprintf(String, "%d.%02ukHz", STEP_FREQ_TABLE[g_sub_menu_selection] / 100, abs(STEP_FREQ_TABLE[g_sub_menu_selection]) % 100); + sprintf(String, "%d.%02ukHz", STEP_FREQ_TABLE[g_sub_menu_selection] / 100, STEP_FREQ_TABLE[g_sub_menu_selection] % 100); break; case MENU_TXP: