mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-05-19 08:21:18 +03:00
Fix PTT bug
This commit is contained in:
parent
79dae75556
commit
023e7b6ee3
9
Makefile
9
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)
|
||||
|
@ -1792,7 +1792,6 @@ 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;
|
||||
}
|
||||
@ -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
|
||||
{
|
||||
|
@ -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) // " "
|
||||
|
@ -822,23 +822,21 @@ void MAIN_ProcessKeys(key_code_t Key, bool key_pressed, bool key_held)
|
||||
#endif
|
||||
|
||||
if (g_dtmf_input_mode)
|
||||
{
|
||||
if (key_pressed && !key_held)
|
||||
{
|
||||
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_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
g_request_display_screen = DISPLAY_MAIN;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch (Key)
|
||||
{
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -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)
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user