0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-05-19 08:21:18 +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

@ -8,7 +8,7 @@ ENABLE_SWD := 0
ENABLE_OVERLAY := 0 ENABLE_OVERLAY := 0
ENABLE_LTO := 1 ENABLE_LTO := 1
ENABLE_UART := 1 ENABLE_UART := 1
ENABLE_UART_DEBUG := 0 ENABLE_UART_DEBUG := 1
ENABLE_AIRCOPY := 1 ENABLE_AIRCOPY := 1
ENABLE_AIRCOPY_FREQ := 1 ENABLE_AIRCOPY_FREQ := 1
ENABLE_FMRADIO := 1 ENABLE_FMRADIO := 1

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) 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_tx_10ms(void);
void AIRCOPY_process_FSK_rx_10ms(const uint16_t interrupt_status_bits); void AIRCOPY_process_FSK_rx_10ms(const uint16_t interrupt_status_bits);
void AIRCOPY_stop_FSK_tx(void); 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 #endif

View File

@ -1324,14 +1324,6 @@ void APP_CheckKeys(void)
if (g_setting_killed) if (g_setting_killed)
return; 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 // 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) if (g_screen_to_display != DISPLAY_AIRCOPY)
APP_ProcessKey(g_key_prev, false, g_key_held); APP_ProcessKey(g_key_prev, false, g_key_held);
else else
AIRCOPY_ProcessKeys(g_key_prev, false, g_key_held); AIRCOPY_ProcessKey(g_key_prev, false, g_key_held);
#else #else
APP_ProcessKey(g_key_prev, false, g_key_held); APP_ProcessKey(g_key_prev, false, g_key_held);
#endif #endif
@ -1458,7 +1450,7 @@ void APP_CheckKeys(void)
if (g_screen_to_display != DISPLAY_AIRCOPY) if (g_screen_to_display != DISPLAY_AIRCOPY)
APP_ProcessKey(g_key_prev, true, g_key_held); APP_ProcessKey(g_key_prev, true, g_key_held);
else else
AIRCOPY_ProcessKeys(g_key_prev, true, g_key_held); AIRCOPY_ProcessKey(g_key_prev, true, g_key_held);
#else #else
APP_ProcessKey(g_key_prev, true, g_key_held); APP_ProcessKey(g_key_prev, true, g_key_held);
#endif #endif
@ -1483,7 +1475,7 @@ void APP_CheckKeys(void)
if (g_screen_to_display != DISPLAY_AIRCOPY) if (g_screen_to_display != DISPLAY_AIRCOPY)
APP_ProcessKey(g_key_prev, true, g_key_held); APP_ProcessKey(g_key_prev, true, g_key_held);
else else
AIRCOPY_ProcessKeys(g_key_prev, true, g_key_held); AIRCOPY_ProcessKey(g_key_prev, true, g_key_held);
#else #else
APP_ProcessKey(g_key_prev, true, g_key_held); APP_ProcessKey(g_key_prev, true, g_key_held);
#endif #endif
@ -1507,7 +1499,7 @@ void APP_CheckKeys(void)
if (g_screen_to_display != DISPLAY_AIRCOPY) if (g_screen_to_display != DISPLAY_AIRCOPY)
APP_ProcessKey(g_key_prev, true, g_key_held); APP_ProcessKey(g_key_prev, true, g_key_held);
else else
AIRCOPY_ProcessKeys(g_key_prev, true, g_key_held); AIRCOPY_ProcessKey(g_key_prev, true, g_key_held);
#else #else
APP_ProcessKey(g_key_prev, true, g_key_held); APP_ProcessKey(g_key_prev, true, g_key_held);
#endif #endif
@ -2401,8 +2393,8 @@ static void APP_ProcessKey(const key_code_t Key, const bool key_pressed, const b
} }
// key beep // key beep
if (Key != KEY_PTT && !key_held && key_pressed) // if (Key != KEY_PTT && !key_held && key_pressed)
g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; // 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 #ifdef ENABLE_AIRCOPY
case DISPLAY_AIRCOPY: case DISPLAY_AIRCOPY:
AIRCOPY_ProcessKeys(Key, key_pressed, key_held); AIRCOPY_ProcessKey(Key, key_pressed, key_held);
break; break;
#endif #endif

View File

@ -122,7 +122,8 @@ static void SCANNER_Key_EXIT(bool key_pressed, bool key_held)
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
g_another_voice_id = VOICE_ID_CANCEL; g_another_voice_id = VOICE_ID_CANCEL;
#endif #endif
g_request_display_screen = DISPLAY_SCANNER; // g_request_display_screen = DISPLAY_SCANNER;
g_request_display_screen = DISPLAY_MAIN;
break; 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; g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
return; return;
@ -160,7 +161,7 @@ static void SCANNER_Key_MENU(bool key_pressed, bool key_held)
switch (g_scanner_edit_state) switch (g_scanner_edit_state)
{ {
case SCAN_EDIT_STATE_NONE: case SCAN_EDIT_STATE_NONE:
if (!g_scan_single_frequency) /* if (!g_scan_single_frequency)
{ {
#if 0 #if 0
uint32_t Freq250 = FREQUENCY_FloorToStep(g_scan_frequency, 250, 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 #endif
} }
*/
if (g_tx_vfo->channel_save <= USER_CHANNEL_LAST) 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_scan_channel = g_tx_vfo->channel_save;
g_show_chan_prefix = RADIO_CheckValidChannel(g_tx_vfo->channel_save, false, 0); g_show_chan_prefix = RADIO_CheckValidChannel(g_tx_vfo->channel_save, false, 0);
g_scanner_edit_state = SCAN_EDIT_STATE_SAVE; g_scanner_edit_state = SCAN_EDIT_STATE_SAVE;
} }
else else
{ { // save the VFO
#if 1 if (!g_scan_single_frequency)
// save the VFO { // 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_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
} }
g_scan_css_state = SCAN_CSS_STATE_FOUND; g_scan_css_state = SCAN_CSS_STATE_FOUND;

Binary file not shown.

Binary file not shown.

View File

@ -97,7 +97,7 @@ void UI_DisplayScanner(void)
{ {
default: default:
case CODE_TYPE_OFF: case CODE_TYPE_OFF:
strcpy(String, "CODE ???"); strcpy(String, "CODE none");
break; break;
case CODE_TYPE_CONTINUOUS_TONE: case CODE_TYPE_CONTINUOUS_TONE:
sprintf(String, "CTCSS %u.%uHz", CTCSS_OPTIONS[g_scan_css_result_code] / 10, CTCSS_OPTIONS[g_scan_css_result_code] % 10); sprintf(String, "CTCSS %u.%uHz", CTCSS_OPTIONS[g_scan_css_result_code] / 10, CTCSS_OPTIONS[g_scan_css_result_code] % 10);
@ -110,7 +110,7 @@ void UI_DisplayScanner(void)
break; break;
case SCAN_CSS_STATE_FAILED: case SCAN_CSS_STATE_FAILED:
strcpy(String, "CODE not found"); strcpy(String, "CODE none");
break; break;
} }
@ -145,7 +145,7 @@ void UI_DisplayScanner(void)
break; break;
case SCAN_CSS_STATE_FAILED: case SCAN_CSS_STATE_FAILED:
if (g_scan_single_frequency) if (!g_scan_single_frequency)
{ {
strcpy(String, "* repeat M save"); strcpy(String, "* repeat M save");
text_centered = true; text_centered = true;
@ -174,7 +174,8 @@ void UI_DisplayScanner(void)
break; break;
case SCAN_EDIT_STATE_DONE: case SCAN_EDIT_STATE_DONE:
strcpy(String, "* repeat M save"); // strcpy(String, "* repeat M save");
strcpy(String, "* repeat");
text_centered = true; text_centered = true;
break; break;
} }