mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 06:39:49 +03:00
improve TX offset menu function
This commit is contained in:
23
app/app.c
23
app/app.c
@ -908,16 +908,19 @@ void APP_process_radio_interrupts(void)
|
||||
int_bits = BK4819_ReadRegister(0x02);
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
{
|
||||
int i;
|
||||
UART_printf("int bits %04X %04X ", reg_c, int_bits);
|
||||
for (i = 15; i >= 0; i--)
|
||||
UART_printf("%c", (reg_c & (1u << i)) ? '#' : '.');
|
||||
UART_SendText(" ");
|
||||
for (i = 15; i >= 0; i--)
|
||||
UART_printf("%c", (int_bits & (1u << i)) ? '#' : '.');
|
||||
UART_SendText("\r\n");
|
||||
}
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
if (g_current_display_screen != DISPLAY_AIRCOPY)
|
||||
#endif
|
||||
{
|
||||
int i;
|
||||
UART_printf("int bits %04X %04X ", reg_c, int_bits);
|
||||
for (i = 15; i >= 0; i--)
|
||||
UART_printf("%c", (reg_c & (1u << i)) ? '#' : '.');
|
||||
UART_SendText(" ");
|
||||
for (i = 15; i >= 0; i--)
|
||||
UART_printf("%c", (int_bits & (1u << i)) ? '#' : '.');
|
||||
UART_SendText("\r\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (int_bits & BK4819_REG_02_DTMF_5TONE_FOUND)
|
||||
|
24
app/menu.c
24
app/menu.c
@ -1433,6 +1433,11 @@ static void MENU_Key_0_to_9(key_code_t Key, bool key_pressed, bool key_held)
|
||||
{
|
||||
uint32_t Frequency;
|
||||
|
||||
NUMBER_Get(g_input_box, &Frequency);
|
||||
|
||||
if (g_input_box_index > 0)
|
||||
g_sub_menu_selection = Frequency;
|
||||
|
||||
if (g_input_box_index < 8)
|
||||
{ // not yet enough characters
|
||||
#ifdef ENABLE_VOICE
|
||||
@ -1441,13 +1446,12 @@ static void MENU_Key_0_to_9(key_code_t Key, bool key_pressed, bool key_held)
|
||||
return;
|
||||
}
|
||||
|
||||
g_input_box_index = 0;
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
g_another_voice_id = (voice_id_t)Key;
|
||||
#endif
|
||||
|
||||
NUMBER_Get(g_input_box, &Frequency);
|
||||
g_input_box_index = 0;
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
UART_printf("offset 3 %u\r\n", Frequency);
|
||||
#endif
|
||||
@ -1460,7 +1464,7 @@ static void MENU_Key_0_to_9(key_code_t Key, bool key_pressed, bool key_held)
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
UART_printf("offset 4 %u\r\n", Frequency);
|
||||
// UART_printf("offset 4 %u\r\n", Frequency);
|
||||
#endif
|
||||
|
||||
g_sub_menu_selection = Frequency;
|
||||
@ -1575,9 +1579,9 @@ static void MENU_Key_EXIT(bool key_pressed, bool key_held)
|
||||
g_input_box_index = 0;
|
||||
g_flag_refresh_menu = true;
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
#ifdef ENABLE_VOICE
|
||||
g_another_voice_id = VOICE_ID_CANCEL;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else
|
||||
g_input_box[--g_input_box_index] = 10;
|
||||
@ -1588,9 +1592,9 @@ static void MENU_Key_EXIT(bool key_pressed, bool key_held)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
#ifdef ENABLE_VOICE
|
||||
g_another_voice_id = VOICE_ID_CANCEL;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
g_request_display_screen = DISPLAY_MAIN;
|
||||
|
||||
@ -1604,9 +1608,9 @@ static void MENU_Key_EXIT(bool key_pressed, bool key_held)
|
||||
{
|
||||
MENU_stop_css_scan();
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
#ifdef ENABLE_VOICE
|
||||
g_another_voice_id = VOICE_ID_SCANNING_STOP;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
g_request_display_screen = DISPLAY_MENU;
|
||||
}
|
||||
|
Reference in New Issue
Block a user