0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 14:48:03 +03:00

some F+4 F+* fixes, more to come

This commit is contained in:
OneOfEleven
2023-10-12 23:43:45 +01:00
parent 55ceb92a61
commit 75d4f13d7b
8 changed files with 34 additions and 38 deletions

View File

@ -455,7 +455,7 @@ static void AIRCOPY_Key_MENU(bool key_pressed, bool key_held)
}
}
void AIRCOPY_ProcessKeys(key_code_t Key, bool key_pressed, bool key_held)
void AIRCOPY_ProcessKey(key_code_t Key, bool key_pressed, bool key_held)
{
switch (Key)
{

View File

@ -40,6 +40,6 @@ extern uint16_t g_fsk_tx_timeout_10ms;
void AIRCOPY_process_FSK_tx_10ms(void);
void AIRCOPY_process_FSK_rx_10ms(const uint16_t interrupt_status_bits);
void AIRCOPY_stop_FSK_tx(void);
void AIRCOPY_ProcessKeys(key_code_t key, bool key_pressed, bool key_held);
void AIRCOPY_ProcessKey(key_code_t key, bool key_pressed, bool key_held);
#endif

View File

@ -1324,14 +1324,6 @@ void APP_CheckKeys(void)
if (g_setting_killed)
return;
#ifdef ENABLE_AIRCOPY
if (g_screen_to_display == DISPLAY_AIRCOPY &&
(g_aircopy_state == AIRCOPY_RX || g_aircopy_state == AIRCOPY_TX))
{ // AIRCOPY is busy RX/TX or we've been killed
// return;
}
#endif
// *****************
// PTT is treated completely separately from all the other buttons
@ -1418,7 +1410,7 @@ void APP_CheckKeys(void)
if (g_screen_to_display != DISPLAY_AIRCOPY)
APP_ProcessKey(g_key_prev, false, g_key_held);
else
AIRCOPY_ProcessKeys(g_key_prev, false, g_key_held);
AIRCOPY_ProcessKey(g_key_prev, false, g_key_held);
#else
APP_ProcessKey(g_key_prev, false, g_key_held);
#endif
@ -1458,7 +1450,7 @@ void APP_CheckKeys(void)
if (g_screen_to_display != DISPLAY_AIRCOPY)
APP_ProcessKey(g_key_prev, true, g_key_held);
else
AIRCOPY_ProcessKeys(g_key_prev, true, g_key_held);
AIRCOPY_ProcessKey(g_key_prev, true, g_key_held);
#else
APP_ProcessKey(g_key_prev, true, g_key_held);
#endif
@ -1483,7 +1475,7 @@ void APP_CheckKeys(void)
if (g_screen_to_display != DISPLAY_AIRCOPY)
APP_ProcessKey(g_key_prev, true, g_key_held);
else
AIRCOPY_ProcessKeys(g_key_prev, true, g_key_held);
AIRCOPY_ProcessKey(g_key_prev, true, g_key_held);
#else
APP_ProcessKey(g_key_prev, true, g_key_held);
#endif
@ -1507,7 +1499,7 @@ void APP_CheckKeys(void)
if (g_screen_to_display != DISPLAY_AIRCOPY)
APP_ProcessKey(g_key_prev, true, g_key_held);
else
AIRCOPY_ProcessKeys(g_key_prev, true, g_key_held);
AIRCOPY_ProcessKey(g_key_prev, true, g_key_held);
#else
APP_ProcessKey(g_key_prev, true, g_key_held);
#endif
@ -2401,8 +2393,8 @@ static void APP_ProcessKey(const key_code_t Key, const bool key_pressed, const b
}
// key beep
if (Key != KEY_PTT && !key_held && key_pressed)
g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
// if (Key != KEY_PTT && !key_held && key_pressed)
// g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
// ********************
@ -2585,7 +2577,7 @@ static void APP_ProcessKey(const key_code_t Key, const bool key_pressed, const b
#ifdef ENABLE_AIRCOPY
case DISPLAY_AIRCOPY:
AIRCOPY_ProcessKeys(Key, key_pressed, key_held);
AIRCOPY_ProcessKey(Key, key_pressed, key_held);
break;
#endif

View File

@ -111,7 +111,7 @@ static void SCANNER_Key_EXIT(bool key_pressed, bool key_held)
if (g_input_box_index > 0)
{
g_input_box[--g_input_box_index] = 10;
g_request_display_screen = DISPLAY_SCANNER;
g_request_display_screen = DISPLAY_SCANNER;
break;
}
@ -122,7 +122,8 @@ static void SCANNER_Key_EXIT(bool key_pressed, bool key_held)
#ifdef ENABLE_VOICE
g_another_voice_id = VOICE_ID_CANCEL;
#endif
g_request_display_screen = DISPLAY_SCANNER;
// g_request_display_screen = DISPLAY_SCANNER;
g_request_display_screen = DISPLAY_MAIN;
break;
}
}
@ -149,7 +150,7 @@ static void SCANNER_Key_MENU(bool key_pressed, bool key_held)
}
}
if (g_scan_css_state == SCAN_CSS_STATE_FAILED)
if (g_scan_css_state == SCAN_CSS_STATE_FAILED && g_scan_single_frequency)
{
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
return;
@ -160,7 +161,7 @@ static void SCANNER_Key_MENU(bool key_pressed, bool key_held)
switch (g_scanner_edit_state)
{
case SCAN_EDIT_STATE_NONE:
if (!g_scan_single_frequency)
/* if (!g_scan_single_frequency)
{
#if 0
uint32_t Freq250 = FREQUENCY_FloorToStep(g_scan_frequency, 250, 0);
@ -249,24 +250,26 @@ static void SCANNER_Key_MENU(bool key_pressed, bool key_held)
}
#endif
}
*/
if (g_tx_vfo->channel_save <= USER_CHANNEL_LAST)
{
{ // save to channel
if (!g_scan_single_frequency)
{ // round to the nearest step size
const uint32_t step = g_tx_vfo->step_freq;
g_scan_frequency = ((g_scan_frequency + (step / 2)) / step) * step;
}
g_scan_channel = g_tx_vfo->channel_save;
g_show_chan_prefix = RADIO_CheckValidChannel(g_tx_vfo->channel_save, false, 0);
g_scanner_edit_state = SCAN_EDIT_STATE_SAVE;
}
else
{
#if 1
// save the VFO
g_scanner_edit_state = SCAN_EDIT_STATE_DONE;
#else
// save to a desired channel
g_scan_channel = RADIO_FindNextChannel(0, SCAN_FWD, false, g_eeprom.tx_vfo);
g_show_chan_prefix = RADIO_CheckValidChannel(g_scan_channel, false, 0);
g_scanner_edit_state = SCAN_EDIT_STATE_SAVE;
#endif
{ // save the VFO
if (!g_scan_single_frequency)
{ // round to the nearest step size
const uint32_t step = g_tx_vfo->step_freq;
g_scan_frequency = ((g_scan_frequency + (step / 2)) / step) * step;
}
g_scanner_edit_state = SCAN_EDIT_STATE_DONE;
}
g_scan_css_state = SCAN_CSS_STATE_FOUND;