0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-20 06:58:39 +03:00

better manual freq up/dn but scan, faster freq scan

This commit is contained in:
OneOfEleven
2023-10-30 21:48:29 +00:00
parent 145e8b4a14
commit b85ea562c7
15 changed files with 60 additions and 96 deletions

View File

@ -52,7 +52,7 @@ bool scanning_paused(void)
{ // scanning isn't paused
return false;
}
return true;
}
@ -229,7 +229,7 @@ void processFKeyFunction(const key_code_t Key)
#endif
}
break;
case KEY_1: // BAND
@ -251,7 +251,7 @@ void processFKeyFunction(const key_code_t Key)
else
Band = BAND6_400MHz; // jump to next band
g_tx_vfo->band = Band;
g_eeprom.screen_channel[Vfo] = FREQ_CHANNEL_FIRST + Band;
g_eeprom.freq_channel[Vfo] = FREQ_CHANNEL_FIRST + Band;
@ -694,10 +694,10 @@ void MAIN_Key_EXIT(bool key_pressed, bool key_held)
if (!key_held)
return;
if (key_pressed)
return;
#ifdef ENABLE_FMRADIO
if (g_fm_radio_mode)
{
@ -705,7 +705,7 @@ void MAIN_Key_EXIT(bool key_pressed, bool key_held)
return;
}
#endif
if (g_input_box_index > 0 || g_dtmf_input_box_index > 0 || g_dtmf_input_mode)
{ // cancel key input mode (channel/frequency entry)
g_dtmf_input_mode = false;
@ -878,7 +878,7 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio
{ // re-enable the squelch
g_monitor_enabled = false;
// GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
APP_start_listening();
}
#endif
@ -891,9 +891,9 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio
SETTINGS_save_channel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, 1);
RADIO_ApplyOffset(g_tx_vfo, true);
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
UART_printf("save chan %u\r\n", g_tx_vfo->channel_save);
// UART_printf("save chan %u\r\n", g_tx_vfo->channel_save);
#endif
}
}
@ -988,7 +988,8 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio
if (key_held && key_pressed && !monitor_was_enabled)
{ // open the squelch if the user holds the key down
g_monitor_enabled = true;
APP_start_listening();
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
// APP_start_listening();
}
#endif
@ -1000,17 +1001,18 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio
}
// channel mode
g_tx_vfo->freq_in_channel = 0xff;
#ifdef ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS
if (!key_held && key_pressed)
monitor_was_enabled = g_monitor_enabled;
if (key_held && key_pressed && !monitor_was_enabled)
{ // open the squelch if the user holds the key down
g_monitor_enabled = true;
APP_start_listening();
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
// APP_start_listening();
}
#endif
@ -1049,20 +1051,18 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio
return;
}
// g_speaker_enabled = false;
// g_monitor_enabled = false;
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
// jump to the next channel
APP_channel_next(false, Direction);
// go NOW
g_scan_pause_tick_10ms = 0;
g_scan_pause_tick_10ms = 0;
g_scan_pause_time_mode = false;
g_squelch_open = false;
g_rx_reception_mode = RX_MODE_NONE;
FUNCTION_Select(FUNCTION_FOREGROUND);
g_ptt_was_released = true;
}