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 =
|
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 -std=c11 -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
|
|
||||||
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)
|
||||||
|
@ -1792,9 +1792,8 @@ void cancelUserInputModes(void)
|
|||||||
{
|
{
|
||||||
DTMF_clear_input_box();
|
DTMF_clear_input_box();
|
||||||
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
|
|
||||||
g_request_display_screen = DISPLAY_MAIN;
|
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)
|
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_fkey_pressed = false;
|
||||||
g_input_box_index = 0;
|
g_input_box_index = 0;
|
||||||
g_key_input_count_down = 0;
|
g_key_input_count_down = 0;
|
||||||
|
|
||||||
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
g_update_display = 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)
|
if (Key == KEY_PTT && g_ptt_was_pressed)
|
||||||
{
|
{
|
||||||
flag = key_held;
|
flag = key_held;
|
||||||
|
|
||||||
if (!key_pressed)
|
if (!key_pressed)
|
||||||
{
|
{
|
||||||
flag = true;
|
flag = true;
|
||||||
@ -2345,7 +2342,6 @@ static void APP_ProcessKey(const key_code_t Key, const bool key_pressed, const b
|
|||||||
{
|
{
|
||||||
if (key_held)
|
if (key_held)
|
||||||
flag = true;
|
flag = true;
|
||||||
|
|
||||||
// if (!key_pressed)
|
// if (!key_pressed)
|
||||||
if (key_pressed) // I now use key released for button press detections
|
if (key_pressed) // I now use key released for button press detections
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "app/scanner.h"
|
#include "app/scanner.h"
|
||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
#include "driver/keyboard.h"
|
#include "driver/keyboard.h"
|
||||||
|
#include "driver/uart.h"
|
||||||
#include "dtmf.h"
|
#include "dtmf.h"
|
||||||
#include "external/printf/printf.h"
|
#include "external/printf/printf.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
@ -159,6 +160,10 @@ void GENERIC_Key_PTT(bool key_pressed)
|
|||||||
|
|
||||||
// PTT 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
|
if (g_scan_state_dir != SCAN_OFF || // frequency/channel scanning
|
||||||
g_screen_to_display == DISPLAY_SCANNER || // CTCSS/CDCSS scanning
|
g_screen_to_display == DISPLAY_SCANNER || // CTCSS/CDCSS scanning
|
||||||
g_css_scan_mode != CSS_SCAN_MODE_OFF) // " "
|
g_css_scan_mode != CSS_SCAN_MODE_OFF) // " "
|
||||||
|
16
app/main.c
16
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 (g_dtmf_input_mode)
|
||||||
{
|
{
|
||||||
if (key_pressed && !key_held)
|
const char Character = DTMF_GetCharacter(Key);
|
||||||
{
|
if (Character != 0xFF)
|
||||||
const char Character = DTMF_GetCharacter(Key);
|
{ // add key to DTMF string
|
||||||
if (Character != 0xFF)
|
if (key_pressed && !key_held)
|
||||||
{ // add key to DTMF string
|
{
|
||||||
|
|
||||||
DTMF_Append(Character);
|
DTMF_Append(Character);
|
||||||
|
|
||||||
g_key_input_count_down = key_input_timeout_500ms;
|
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_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
||||||
g_request_display_screen = DISPLAY_MAIN;
|
g_request_display_screen = DISPLAY_MAIN;
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (Key)
|
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
|
else
|
||||||
if (blink == 0)
|
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)
|
void UI_DisplayBattery(const unsigned int level, const unsigned int blink)
|
||||||
|
@ -539,7 +539,7 @@ void UI_DisplayMenu(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
case MENU_STEP:
|
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;
|
break;
|
||||||
|
|
||||||
case MENU_TXP:
|
case MENU_TXP:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user