mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 22:31:25 +03:00
Can now interrupt RF scanning with any other function
This commit is contained in:
parent
73572f24b1
commit
d47cd80fd4
@ -90,7 +90,7 @@ void ACTION_Monitor(void)
|
|||||||
|
|
||||||
if (g_scan_state_dir != SCAN_STATE_DIR_OFF)
|
if (g_scan_state_dir != SCAN_STATE_DIR_OFF)
|
||||||
{
|
{
|
||||||
g_scan_pause_10ms = scan_pause_1_10ms;
|
g_scan_pause_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
||||||
g_scan_pause_mode = true;
|
g_scan_pause_mode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
185
app/app.c
185
app/app.c
@ -103,7 +103,7 @@ static void APP_check_for_incoming_rx(void)
|
|||||||
if (g_css_scan_mode != CSS_SCAN_MODE_OFF && g_rx_reception_mode == RX_MODE_NONE)
|
if (g_css_scan_mode != CSS_SCAN_MODE_OFF && g_rx_reception_mode == RX_MODE_NONE)
|
||||||
{ // CTCSS/DTS scanning
|
{ // CTCSS/DTS scanning
|
||||||
|
|
||||||
g_scan_pause_10ms = scan_pause_5_10ms;
|
g_scan_pause_10ms = scan_pause_code_10ms;
|
||||||
g_rx_reception_mode = RX_MODE_DETECTED;
|
g_rx_reception_mode = RX_MODE_DETECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,62 +118,32 @@ static void APP_check_for_incoming_rx(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (g_current_function != FUNCTION_INCOMING)
|
goto done;
|
||||||
{
|
|
||||||
FUNCTION_Select(FUNCTION_INCOMING);
|
|
||||||
//g_update_display = true;
|
|
||||||
|
|
||||||
APP_update_rssi(g_eeprom.rx_vfo);
|
|
||||||
g_update_rssi = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// dual watch is enabled and we're RX'ing a signal
|
// dual watch is enabled and we're RX'ing a signal
|
||||||
|
|
||||||
if (g_rx_reception_mode != RX_MODE_NONE)
|
if (g_rx_reception_mode != RX_MODE_NONE)
|
||||||
{
|
goto done;
|
||||||
if (g_current_function != FUNCTION_INCOMING)
|
|
||||||
{
|
|
||||||
FUNCTION_Select(FUNCTION_INCOMING);
|
|
||||||
//g_update_display = true;
|
|
||||||
|
|
||||||
APP_update_rssi(g_eeprom.rx_vfo);
|
g_dual_watch_delay_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
||||||
g_update_rssi = true;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_dual_watch_count_down_10ms = dual_watch_count_after_rx_10ms;
|
|
||||||
g_schedule_dual_watch = false;
|
|
||||||
|
|
||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // RF scanning
|
{ // RF scanning
|
||||||
if (g_rx_reception_mode != RX_MODE_NONE)
|
if (g_rx_reception_mode != RX_MODE_NONE)
|
||||||
{
|
goto done;
|
||||||
if (g_current_function != FUNCTION_INCOMING)
|
|
||||||
{
|
|
||||||
FUNCTION_Select(FUNCTION_INCOMING);
|
|
||||||
//g_update_display = true;
|
|
||||||
|
|
||||||
APP_update_rssi(g_eeprom.rx_vfo);
|
g_scan_pause_10ms = scan_pause_chan_10ms;
|
||||||
g_update_rssi = true;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_scan_pause_10ms = scan_pause_3_10ms;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_rx_reception_mode = RX_MODE_DETECTED;
|
g_rx_reception_mode = RX_MODE_DETECTED;
|
||||||
|
|
||||||
|
done:
|
||||||
if (g_current_function != FUNCTION_INCOMING)
|
if (g_current_function != FUNCTION_INCOMING)
|
||||||
{
|
{
|
||||||
FUNCTION_Select(FUNCTION_INCOMING);
|
FUNCTION_Select(FUNCTION_INCOMING);
|
||||||
//g_update_display = true;
|
|
||||||
|
|
||||||
APP_update_rssi(g_eeprom.rx_vfo);
|
APP_update_rssi(g_eeprom.rx_vfo);
|
||||||
g_update_rssi = true;
|
g_update_rssi = true;
|
||||||
@ -223,7 +193,7 @@ static void APP_process_incoming_rx(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
||||||
{ // not scanning
|
{ // not code scanning
|
||||||
|
|
||||||
#ifdef ENABLE_KILL_REVIVE
|
#ifdef ENABLE_KILL_REVIVE
|
||||||
if (g_rx_vfo->dtmf_decoding_enable || g_setting_radio_disabled)
|
if (g_rx_vfo->dtmf_decoding_enable || g_setting_radio_disabled)
|
||||||
@ -238,9 +208,7 @@ static void APP_process_incoming_rx(void)
|
|||||||
{
|
{
|
||||||
if (g_rx_reception_mode == RX_MODE_DETECTED)
|
if (g_rx_reception_mode == RX_MODE_DETECTED)
|
||||||
{
|
{
|
||||||
g_dual_watch_count_down_10ms = dual_watch_count_after_1_10ms;
|
g_dual_watch_delay_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
||||||
g_schedule_dual_watch = false;
|
|
||||||
|
|
||||||
g_rx_reception_mode = RX_MODE_LISTENING;
|
g_rx_reception_mode = RX_MODE_LISTENING;
|
||||||
|
|
||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
@ -411,7 +379,7 @@ Skip:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SCAN_RESUME_CO:
|
case SCAN_RESUME_CO:
|
||||||
g_scan_pause_10ms = scan_pause_7_10ms;
|
g_scan_pause_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCAN_RESUME_SE:
|
case SCAN_RESUME_SE:
|
||||||
@ -456,13 +424,9 @@ static void APP_process_function(void)
|
|||||||
APP_process_incoming_rx();
|
APP_process_incoming_rx();
|
||||||
|
|
||||||
case FUNCTION_MONITOR:
|
case FUNCTION_MONITOR:
|
||||||
if (g_setting_backlight_on_tx_rx >= 2)
|
|
||||||
backlight_turn_on(backlight_tx_rx_time_500ms);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FUNCTION_RECEIVE:
|
case FUNCTION_RECEIVE:
|
||||||
if (g_setting_backlight_on_tx_rx >= 2)
|
|
||||||
backlight_turn_on(backlight_tx_rx_time_500ms);
|
|
||||||
APP_process_rx();
|
APP_process_rx();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -488,6 +452,9 @@ void APP_start_listening(function_type_t Function, const bool reset_am_fix)
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (g_setting_backlight_on_tx_rx >= 2)
|
||||||
|
backlight_turn_on(backlight_tx_rx_time_500ms);
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
if (g_fm_radio_mode)
|
if (g_fm_radio_mode)
|
||||||
BK1080_Init(0, false);
|
BK1080_Init(0, false);
|
||||||
@ -501,14 +468,14 @@ void APP_start_listening(function_type_t Function, const bool reset_am_fix)
|
|||||||
g_enable_speaker = true;
|
g_enable_speaker = true;
|
||||||
|
|
||||||
if (g_scan_state_dir != SCAN_STATE_DIR_OFF)
|
if (g_scan_state_dir != SCAN_STATE_DIR_OFF)
|
||||||
{ // we're scanning
|
{ // we're RF scanning
|
||||||
|
|
||||||
switch (g_eeprom.scan_resume_mode)
|
switch (g_eeprom.scan_resume_mode)
|
||||||
{
|
{
|
||||||
case SCAN_RESUME_TO:
|
case SCAN_RESUME_TO:
|
||||||
if (!g_scan_pause_mode)
|
if (!g_scan_pause_mode)
|
||||||
{
|
{
|
||||||
g_scan_pause_10ms = scan_pause_1_10ms;
|
g_scan_pause_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
||||||
g_scan_pause_mode = true;
|
g_scan_pause_mode = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -519,7 +486,9 @@ void APP_start_listening(function_type_t Function, const bool reset_am_fix)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_scan_keep_frequency = true;
|
g_scan_restore_channel = 0xff;
|
||||||
|
g_scan_restore_frequency = 0;
|
||||||
|
// g_scan_keep_frequency = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
@ -542,9 +511,7 @@ void APP_start_listening(function_type_t Function, const bool reset_am_fix)
|
|||||||
g_eeprom.dual_watch != DUAL_WATCH_OFF)
|
g_eeprom.dual_watch != DUAL_WATCH_OFF)
|
||||||
{ // not scanning, but dual watch is enabled
|
{ // not scanning, but dual watch is enabled
|
||||||
|
|
||||||
g_dual_watch_count_down_10ms = dual_watch_count_after_2_10ms;
|
g_dual_watch_delay_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
||||||
g_schedule_dual_watch = false;
|
|
||||||
|
|
||||||
g_rx_vfo_is_active = true;
|
g_rx_vfo_is_active = true;
|
||||||
|
|
||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
@ -566,12 +533,8 @@ void APP_start_listening(function_type_t Function, const bool reset_am_fix)
|
|||||||
AM_fix_10ms(chan);
|
AM_fix_10ms(chan);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // FM RX mode
|
|
||||||
BK4819_WriteRegister(BK4819_REG_13, (lna_short << 8) | (lna << 5) | (mixer << 3) | (pga << 0));
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
BK4819_WriteRegister(BK4819_REG_13, (lna_short << 8) | (lna << 5) | (mixer << 3) | (pga << 0));
|
|
||||||
#endif
|
#endif
|
||||||
|
BK4819_WriteRegister(BK4819_REG_13, (lna_short << 8) | (lna << 5) | (mixer << 3) | (pga << 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
// AF gain - original QS values
|
// AF gain - original QS values
|
||||||
@ -599,7 +562,7 @@ void APP_start_listening(function_type_t Function, const bool reset_am_fix)
|
|||||||
#else
|
#else
|
||||||
if (Function == FUNCTION_MONITOR)
|
if (Function == FUNCTION_MONITOR)
|
||||||
#endif
|
#endif
|
||||||
{ // squelch is disabled
|
{ // monitor mode (open squelch)
|
||||||
if (g_screen_to_display != DISPLAY_MENU) // 1of11 .. don't close the menu
|
if (g_screen_to_display != DISPLAY_MENU) // 1of11 .. don't close the menu
|
||||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||||
}
|
}
|
||||||
@ -637,36 +600,42 @@ uint32_t APP_set_frequency_by_step(vfo_info_t *pInfo, int8_t Step)
|
|||||||
|
|
||||||
void APP_stop_scan(void)
|
void APP_stop_scan(void)
|
||||||
{
|
{
|
||||||
const uint8_t Previous = g_scan_restore_channel;
|
|
||||||
|
|
||||||
if (g_scan_state_dir == SCAN_STATE_DIR_OFF)
|
if (g_scan_state_dir == SCAN_STATE_DIR_OFF)
|
||||||
return; // but, but, we weren't doing anything !
|
return; // but, but, we weren't doing anything !
|
||||||
|
|
||||||
|
// yes we were ;)
|
||||||
|
|
||||||
g_scan_state_dir = SCAN_STATE_DIR_OFF;
|
g_scan_state_dir = SCAN_STATE_DIR_OFF;
|
||||||
|
|
||||||
if (!g_scan_keep_frequency)
|
if (g_scan_restore_channel != 0xff || (g_scan_restore_frequency > 0 && g_scan_restore_frequency != 0xffffffff))
|
||||||
{
|
{ // revert to where we were before starting the scan
|
||||||
|
|
||||||
if (g_scan_next_channel <= USER_CHANNEL_LAST)
|
if (g_scan_next_channel <= USER_CHANNEL_LAST)
|
||||||
|
{ // we were channel scanning
|
||||||
|
|
||||||
|
if (g_scan_restore_channel != 0xff)
|
||||||
{
|
{
|
||||||
g_eeprom.user_channel[g_eeprom.rx_vfo] = g_scan_restore_channel;
|
g_eeprom.user_channel[g_eeprom.rx_vfo] = g_scan_restore_channel;
|
||||||
g_eeprom.screen_channel[g_eeprom.rx_vfo] = Previous;
|
g_eeprom.screen_channel[g_eeprom.rx_vfo] = g_scan_restore_channel;
|
||||||
|
|
||||||
RADIO_ConfigureChannel(g_eeprom.rx_vfo, VFO_CONFIGURE_RELOAD);
|
RADIO_configure_channel(g_eeprom.rx_vfo, VFO_CONFIGURE_RELOAD);
|
||||||
|
RADIO_setup_registers(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if (g_scan_restore_frequency > 0 && g_scan_restore_frequency != 0xffffffff)
|
||||||
{
|
{
|
||||||
g_rx_vfo->freq_config_rx.frequency = g_scan_restore_frequency;
|
g_rx_vfo->freq_config_rx.frequency = g_scan_restore_frequency;
|
||||||
|
|
||||||
RADIO_ApplyOffset(g_rx_vfo);
|
RADIO_ApplyOffset(g_rx_vfo);
|
||||||
RADIO_ConfigureSquelchAndOutputPower(g_rx_vfo);
|
RADIO_ConfigureSquelchAndOutputPower(g_rx_vfo);
|
||||||
}
|
|
||||||
|
|
||||||
RADIO_setup_registers(true);
|
RADIO_setup_registers(true);
|
||||||
|
}
|
||||||
|
|
||||||
g_update_display = true;
|
g_update_display = true;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (g_rx_vfo->channel_save > USER_CHANNEL_LAST)
|
if (g_rx_vfo->channel_save > USER_CHANNEL_LAST)
|
||||||
{
|
{
|
||||||
RADIO_ApplyOffset(g_rx_vfo);
|
RADIO_ApplyOffset(g_rx_vfo);
|
||||||
@ -676,6 +645,7 @@ void APP_stop_scan(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SETTINGS_SaveVfoIndices();
|
SETTINGS_SaveVfoIndices();
|
||||||
|
}
|
||||||
|
|
||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
}
|
}
|
||||||
@ -700,7 +670,7 @@ static void APP_next_freq(void)
|
|||||||
#ifdef ENABLE_FASTER_CHANNEL_SCAN
|
#ifdef ENABLE_FASTER_CHANNEL_SCAN
|
||||||
g_scan_pause_10ms = 8; // 80ms
|
g_scan_pause_10ms = 8; // 80ms
|
||||||
#else
|
#else
|
||||||
g_scan_pause_10ms = scan_pause_6_10ms;
|
g_scan_pause_10ms = scan_pause_freq_10ms;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -711,11 +681,11 @@ static void APP_next_freq(void)
|
|||||||
#ifdef ENABLE_FASTER_CHANNEL_SCAN
|
#ifdef ENABLE_FASTER_CHANNEL_SCAN
|
||||||
g_scan_pause_10ms = 10; // 100ms
|
g_scan_pause_10ms = 10; // 100ms
|
||||||
#else
|
#else
|
||||||
g_scan_pause_10ms = scan_pause_6_10ms;
|
g_scan_pause_10ms = scan_pause_freq_10ms;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
g_scan_keep_frequency = false;
|
// g_scan_keep_frequency = false;
|
||||||
g_update_display = true;
|
g_update_display = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -803,7 +773,7 @@ static void APP_next_channel(void)
|
|||||||
g_eeprom.user_channel[g_eeprom.rx_vfo] = g_scan_next_channel;
|
g_eeprom.user_channel[g_eeprom.rx_vfo] = g_scan_next_channel;
|
||||||
g_eeprom.screen_channel[g_eeprom.rx_vfo] = g_scan_next_channel;
|
g_eeprom.screen_channel[g_eeprom.rx_vfo] = g_scan_next_channel;
|
||||||
|
|
||||||
RADIO_ConfigureChannel(g_eeprom.rx_vfo, VFO_CONFIGURE_RELOAD);
|
RADIO_configure_channel(g_eeprom.rx_vfo, VFO_CONFIGURE_RELOAD);
|
||||||
RADIO_setup_registers(true);
|
RADIO_setup_registers(true);
|
||||||
|
|
||||||
g_update_display = true;
|
g_update_display = true;
|
||||||
@ -812,10 +782,10 @@ static void APP_next_channel(void)
|
|||||||
#ifdef ENABLE_FASTER_CHANNEL_SCAN
|
#ifdef ENABLE_FASTER_CHANNEL_SCAN
|
||||||
g_scan_pause_10ms = 9; // 90ms .. <= ~60ms it misses signals (squelch response and/or PLL lock time) ?
|
g_scan_pause_10ms = 9; // 90ms .. <= ~60ms it misses signals (squelch response and/or PLL lock time) ?
|
||||||
#else
|
#else
|
||||||
g_scan_pause_10ms = scan_pause_3_10ms;
|
g_scan_pause_10ms = scan_pause_chan_10ms;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_scan_keep_frequency = false;
|
// g_scan_keep_frequency = false;
|
||||||
|
|
||||||
if (enabled)
|
if (enabled)
|
||||||
if (++g_scan_current_scan_list >= SCAN_NEXT_NUM)
|
if (++g_scan_current_scan_list >= SCAN_NEXT_NUM)
|
||||||
@ -832,6 +802,10 @@ static void APP_next_channel(void)
|
|||||||
|
|
||||||
static void APP_toggle_dual_watch_vfo(void)
|
static void APP_toggle_dual_watch_vfo(void)
|
||||||
{
|
{
|
||||||
|
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||||
|
UART_SendText("dual watch\r\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
if (g_is_noaa_mode)
|
if (g_is_noaa_mode)
|
||||||
{
|
{
|
||||||
@ -856,9 +830,9 @@ static void APP_toggle_dual_watch_vfo(void)
|
|||||||
RADIO_setup_registers(false);
|
RADIO_setup_registers(false);
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
g_dual_watch_count_down_10ms = g_is_noaa_mode ? dual_watch_count_noaa_10ms : dual_watch_count_toggle_10ms;
|
g_dual_watch_delay_10ms = g_is_noaa_mode ? dual_watch_delay_noaa_10ms : dual_watch_delay_toggle_10ms;
|
||||||
#else
|
#else
|
||||||
g_dual_watch_count_down_10ms = dual_watch_count_toggle_10ms;
|
g_dual_watch_delay_10ms = dual_watch_delay_toggle_10ms;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -949,11 +923,9 @@ void APP_process_radio_interrupts(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (g_eeprom.dual_watch != DUAL_WATCH_OFF &&
|
if (g_eeprom.dual_watch != DUAL_WATCH_OFF &&
|
||||||
(g_schedule_dual_watch || g_dual_watch_count_down_10ms < dual_watch_count_after_vox_10ms))
|
(g_dual_watch_delay_10ms == 0 || g_dual_watch_delay_10ms < dual_watch_delay_after_vox_10ms))
|
||||||
{
|
{
|
||||||
g_dual_watch_count_down_10ms = dual_watch_count_after_vox_10ms;
|
g_dual_watch_delay_10ms = dual_watch_delay_after_vox_10ms;
|
||||||
g_schedule_dual_watch = false;
|
|
||||||
|
|
||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1180,27 +1152,21 @@ void APP_process(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// toggle between the VFO's if dual watch is enabled
|
// toggle between the VFO's if dual watch is enabled
|
||||||
if (g_screen_to_display != DISPLAY_SEARCH && g_eeprom.dual_watch != DUAL_WATCH_OFF)
|
if (g_eeprom.dual_watch != DUAL_WATCH_OFF &&
|
||||||
{
|
g_dual_watch_delay_10ms == 0 &&
|
||||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
!g_ptt_is_pressed &&
|
||||||
UART_SendText("dual watch\r\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
if (g_voice_write_index == 0)
|
g_voice_write_index == 0 &&
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
if (g_schedule_dual_watch)
|
|
||||||
{
|
|
||||||
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
|
||||||
{
|
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
if (!g_fm_radio_mode)
|
!g_fm_radio_mode &&
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
if (!g_ptt_is_pressed &&
|
|
||||||
g_dtmf_call_state == DTMF_CALL_STATE_NONE &&
|
g_dtmf_call_state == DTMF_CALL_STATE_NONE &&
|
||||||
g_current_function != FUNCTION_POWER_SAVE)
|
g_screen_to_display != DISPLAY_SEARCH &&
|
||||||
|
g_scan_state_dir == SCAN_STATE_DIR_OFF &&
|
||||||
|
g_css_scan_mode == CSS_SCAN_MODE_OFF &&
|
||||||
|
g_current_function != FUNCTION_POWER_SAVE &&
|
||||||
|
(g_current_function == FUNCTION_FOREGROUND || g_current_function == FUNCTION_POWER_SAVE))
|
||||||
{
|
{
|
||||||
APP_toggle_dual_watch_vfo(); // toggle between the two VFO's
|
APP_toggle_dual_watch_vfo(); // toggle between the two VFO's
|
||||||
|
|
||||||
@ -1210,12 +1176,6 @@ void APP_process(void)
|
|||||||
g_rx_vfo_is_active = false;
|
g_rx_vfo_is_active = false;
|
||||||
g_scan_pause_mode = false;
|
g_scan_pause_mode = false;
|
||||||
g_rx_reception_mode = RX_MODE_NONE;
|
g_rx_reception_mode = RX_MODE_NONE;
|
||||||
g_schedule_dual_watch = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
@ -1311,7 +1271,6 @@ void APP_process(void)
|
|||||||
g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
||||||
{ // dual watch mode, toggle between the two VFO's
|
{ // dual watch mode, toggle between the two VFO's
|
||||||
APP_toggle_dual_watch_vfo();
|
APP_toggle_dual_watch_vfo();
|
||||||
|
|
||||||
g_update_rssi = false;
|
g_update_rssi = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1599,7 +1558,7 @@ void APP_time_slice_10ms(void)
|
|||||||
SETTINGS_SaveChannel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, g_flag_save_channel ? 1 : 0);
|
SETTINGS_SaveChannel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, g_flag_save_channel ? 1 : 0);
|
||||||
g_flag_save_channel = false;
|
g_flag_save_channel = false;
|
||||||
|
|
||||||
RADIO_ConfigureChannel(g_eeprom.tx_vfo, VFO_CONFIGURE);
|
RADIO_configure_channel(g_eeprom.tx_vfo, VFO_CONFIGURE);
|
||||||
RADIO_setup_registers(true);
|
RADIO_setup_registers(true);
|
||||||
|
|
||||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||||
@ -2179,8 +2138,8 @@ void APP_time_slice_500ms(void)
|
|||||||
{
|
{
|
||||||
BK4819_StopScan();
|
BK4819_StopScan();
|
||||||
|
|
||||||
RADIO_ConfigureChannel(0, VFO_CONFIGURE_RELOAD);
|
RADIO_configure_channel(0, VFO_CONFIGURE_RELOAD);
|
||||||
RADIO_ConfigureChannel(1, VFO_CONFIGURE_RELOAD);
|
RADIO_configure_channel(1, VFO_CONFIGURE_RELOAD);
|
||||||
|
|
||||||
RADIO_setup_registers(true);
|
RADIO_setup_registers(true);
|
||||||
}
|
}
|
||||||
@ -2395,9 +2354,10 @@ void APP_channel_next(const bool flag, const scan_state_dir_t scan_direction)
|
|||||||
APP_next_freq();
|
APP_next_freq();
|
||||||
}
|
}
|
||||||
|
|
||||||
g_scan_pause_10ms = scan_pause_2_10ms;
|
g_scan_pause_10ms = scan_pause_css_10ms;
|
||||||
g_scan_pause_mode = false;
|
g_scan_pause_mode = false;
|
||||||
g_scan_keep_frequency = false;
|
|
||||||
|
// g_scan_keep_frequency = false;
|
||||||
|
|
||||||
g_rx_reception_mode = RX_MODE_NONE;
|
g_rx_reception_mode = RX_MODE_NONE;
|
||||||
}
|
}
|
||||||
@ -2522,7 +2482,8 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
|
|||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wtype-limits"
|
#pragma GCC diagnostic ignored "-Wtype-limits"
|
||||||
|
|
||||||
if (g_scan_state_dir != SCAN_STATE_DIR_OFF || g_css_scan_mode != CSS_SCAN_MODE_OFF)
|
// if (g_scan_state_dir != SCAN_STATE_DIR_OFF || g_css_scan_mode != CSS_SCAN_MODE_OFF)
|
||||||
|
if (g_css_scan_mode != CSS_SCAN_MODE_OFF)
|
||||||
{ // FREQ/CTCSS/CDCSS scanning
|
{ // FREQ/CTCSS/CDCSS scanning
|
||||||
|
|
||||||
if ((Key >= KEY_0 && Key <= KEY_9) || Key == KEY_F)
|
if ((Key >= KEY_0 && Key <= KEY_9) || Key == KEY_F)
|
||||||
@ -2800,12 +2761,12 @@ Skip:
|
|||||||
|
|
||||||
if (g_flag_reset_vfos)
|
if (g_flag_reset_vfos)
|
||||||
{
|
{
|
||||||
RADIO_ConfigureChannel(0, g_vfo_configure_mode);
|
RADIO_configure_channel(0, g_vfo_configure_mode);
|
||||||
RADIO_ConfigureChannel(1, g_vfo_configure_mode);
|
RADIO_configure_channel(1, g_vfo_configure_mode);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RADIO_ConfigureChannel(g_eeprom.tx_vfo, g_vfo_configure_mode);
|
RADIO_configure_channel(g_eeprom.tx_vfo, g_vfo_configure_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_request_display_screen == DISPLAY_INVALID)
|
if (g_request_display_screen == DISPLAY_INVALID)
|
||||||
|
@ -158,7 +158,7 @@ void GENERIC_Key_PTT(bool key_pressed)
|
|||||||
else
|
else
|
||||||
if (g_css_scan_mode != CSS_SCAN_MODE_OFF)
|
if (g_css_scan_mode != CSS_SCAN_MODE_OFF)
|
||||||
{ // CTCSS/CDCSS scanning .. stop
|
{ // CTCSS/CDCSS scanning .. stop
|
||||||
MENU_StopCssScan();
|
MENU_stop_css_scan();
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
g_another_voice_id = VOICE_ID_SCANNING_STOP;
|
g_another_voice_id = VOICE_ID_SCANNING_STOP;
|
||||||
|
163
app/main.c
163
app/main.c
@ -39,11 +39,44 @@
|
|||||||
// #include "app/spectrum.h"
|
// #include "app/spectrum.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void MAIN_stop_scan(void)
|
||||||
|
{
|
||||||
|
if (g_scan_state_dir == SCAN_STATE_DIR_OFF)
|
||||||
|
return;
|
||||||
|
|
||||||
|
APP_stop_scan();
|
||||||
|
|
||||||
|
#ifdef ENABLE_VOICE
|
||||||
|
g_another_voice_id = VOICE_ID_SCANNING_STOP;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
g_request_display_screen = DISPLAY_MAIN;
|
||||||
|
g_update_status = true;
|
||||||
|
}
|
||||||
|
|
||||||
void toggle_chan_scanlist(void)
|
void toggle_chan_scanlist(void)
|
||||||
{ // toggle the selected channels scanlist setting
|
{ // toggle the selected channels scanlist setting
|
||||||
|
|
||||||
if (g_screen_to_display == DISPLAY_SEARCH || !IS_USER_CHANNEL(g_tx_vfo->channel_save))
|
if (g_screen_to_display != DISPLAY_MAIN || !IS_USER_CHANNEL(g_tx_vfo->channel_save))
|
||||||
|
{
|
||||||
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_current_function != FUNCTION_FOREGROUND &&
|
||||||
|
g_current_function != FUNCTION_INCOMING &&
|
||||||
|
g_current_function != FUNCTION_MONITOR &&
|
||||||
|
g_current_function != FUNCTION_RECEIVE)
|
||||||
|
{
|
||||||
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_scan_pause_10ms > 0 && !g_scan_pause_mode)
|
||||||
|
{
|
||||||
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_tx_vfo->scanlist_1_participation)
|
if (g_tx_vfo->scanlist_1_participation)
|
||||||
{
|
{
|
||||||
@ -71,7 +104,7 @@ static void processFKeyFunction(const key_code_t Key)
|
|||||||
uint8_t Band;
|
uint8_t Band;
|
||||||
uint8_t Vfo = g_eeprom.tx_vfo;
|
uint8_t Vfo = g_eeprom.tx_vfo;
|
||||||
|
|
||||||
if (g_screen_to_display == DISPLAY_MENU)
|
if (g_current_function == FUNCTION_TRANSMIT || g_screen_to_display == DISPLAY_MENU)
|
||||||
{
|
{
|
||||||
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
return;
|
return;
|
||||||
@ -81,6 +114,9 @@ static void processFKeyFunction(const key_code_t Key)
|
|||||||
{
|
{
|
||||||
case KEY_0: // FM
|
case KEY_0: // FM
|
||||||
|
|
||||||
|
if (g_scan_state_dir != SCAN_STATE_DIR_OFF)
|
||||||
|
MAIN_stop_scan();
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
ACTION_FM();
|
ACTION_FM();
|
||||||
#else
|
#else
|
||||||
@ -90,18 +126,19 @@ static void processFKeyFunction(const key_code_t Key)
|
|||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_1: // BAND
|
case KEY_1: // BAND
|
||||||
|
|
||||||
if (!IS_FREQ_CHANNEL(g_tx_vfo->channel_save))
|
if (!IS_FREQ_CHANNEL(g_tx_vfo->channel_save))
|
||||||
{
|
{
|
||||||
g_fkey_pressed = false;
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
g_update_status = true;
|
|
||||||
g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MAIN_stop_scan();
|
||||||
|
|
||||||
Band = g_tx_vfo->band + 1;
|
Band = g_tx_vfo->band + 1;
|
||||||
if (g_setting_350_enable || Band != BAND5_350MHz)
|
if (g_setting_350_enable || Band != BAND5_350MHz)
|
||||||
{
|
{
|
||||||
@ -118,13 +155,13 @@ static void processFKeyFunction(const key_code_t Key)
|
|||||||
g_request_save_vfo = true;
|
g_request_save_vfo = true;
|
||||||
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
|
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
|
||||||
|
|
||||||
// g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
|
||||||
|
|
||||||
g_request_display_screen = DISPLAY_MAIN;
|
g_request_display_screen = DISPLAY_MAIN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_2: // A/B
|
case KEY_2: // A/B
|
||||||
|
|
||||||
|
MAIN_stop_scan();
|
||||||
|
|
||||||
if (g_eeprom.cross_vfo_rx_tx == CROSS_BAND_CHAN_A)
|
if (g_eeprom.cross_vfo_rx_tx == CROSS_BAND_CHAN_A)
|
||||||
g_eeprom.cross_vfo_rx_tx = CROSS_BAND_CHAN_B;
|
g_eeprom.cross_vfo_rx_tx = CROSS_BAND_CHAN_B;
|
||||||
else
|
else
|
||||||
@ -142,12 +179,13 @@ static void processFKeyFunction(const key_code_t Key)
|
|||||||
g_request_save_settings = 1;
|
g_request_save_settings = 1;
|
||||||
g_flag_reconfigure_vfos = true;
|
g_flag_reconfigure_vfos = true;
|
||||||
|
|
||||||
// g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
|
||||||
|
|
||||||
g_request_display_screen = DISPLAY_MAIN;
|
g_request_display_screen = DISPLAY_MAIN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_3: // VFO/MR
|
case KEY_3: // VFO/MR
|
||||||
|
|
||||||
|
MAIN_stop_scan();
|
||||||
|
|
||||||
if (g_eeprom.vfo_open && IS_NOT_NOAA_CHANNEL(g_tx_vfo->channel_save))
|
if (g_eeprom.vfo_open && IS_NOT_NOAA_CHANNEL(g_tx_vfo->channel_save))
|
||||||
{
|
{
|
||||||
uint8_t Channel;
|
uint8_t Channel;
|
||||||
@ -162,8 +200,6 @@ static void processFKeyFunction(const key_code_t Key)
|
|||||||
|
|
||||||
g_request_save_vfo = true;
|
g_request_save_vfo = true;
|
||||||
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
|
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
|
||||||
|
|
||||||
// g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,8 +216,6 @@ static void processFKeyFunction(const key_code_t Key)
|
|||||||
|
|
||||||
g_request_save_vfo = true;
|
g_request_save_vfo = true;
|
||||||
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
|
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
|
||||||
|
|
||||||
// g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -192,20 +226,20 @@ static void processFKeyFunction(const key_code_t Key)
|
|||||||
|
|
||||||
case KEY_4: // FC
|
case KEY_4: // FC
|
||||||
|
|
||||||
g_fkey_pressed = false;
|
MAIN_stop_scan();
|
||||||
|
|
||||||
g_search_flag_start_scan = true;
|
g_search_flag_start_scan = true;
|
||||||
g_search_single_frequency = false;
|
g_search_single_frequency = false;
|
||||||
g_backup_cross_vfo_rx_tx = g_eeprom.cross_vfo_rx_tx;
|
g_backup_cross_vfo_rx_tx = g_eeprom.cross_vfo_rx_tx;
|
||||||
g_eeprom.cross_vfo_rx_tx = CROSS_BAND_OFF;
|
g_eeprom.cross_vfo_rx_tx = CROSS_BAND_OFF;
|
||||||
g_update_status = true;
|
|
||||||
|
|
||||||
// g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_5: // NOAA
|
case KEY_5: // NOAA
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
|
|
||||||
|
MAIN_stop_scan();
|
||||||
|
|
||||||
if (IS_NOT_NOAA_CHANNEL(g_tx_vfo->channel_save))
|
if (IS_NOT_NOAA_CHANNEL(g_tx_vfo->channel_save))
|
||||||
{
|
{
|
||||||
g_eeprom.screen_channel[Vfo] = g_eeprom.noaa_channel[g_eeprom.tx_vfo];
|
g_eeprom.screen_channel[Vfo] = g_eeprom.noaa_channel[g_eeprom.tx_vfo];
|
||||||
@ -213,6 +247,7 @@ static void processFKeyFunction(const key_code_t Key)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_eeprom.screen_channel[Vfo] = g_eeprom.freq_channel[g_eeprom.tx_vfo];
|
g_eeprom.screen_channel[Vfo] = g_eeprom.freq_channel[g_eeprom.tx_vfo];
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
g_another_voice_id = VOICE_ID_FREQUENCY_MODE;
|
g_another_voice_id = VOICE_ID_FREQUENCY_MODE;
|
||||||
#endif
|
#endif
|
||||||
@ -226,75 +261,89 @@ static void processFKeyFunction(const key_code_t Key)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_6: // H/M/L
|
case KEY_6: // H/M/L
|
||||||
|
|
||||||
|
if (g_scan_state_dir == SCAN_STATE_DIR_OFF)
|
||||||
|
{
|
||||||
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ACTION_Power();
|
ACTION_Power();
|
||||||
// g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_7: // VOX
|
case KEY_7: // VOX
|
||||||
|
|
||||||
#ifdef ENABLE_VOX
|
#ifdef ENABLE_VOX
|
||||||
|
MAIN_stop_scan();
|
||||||
|
|
||||||
ACTION_Vox();
|
ACTION_Vox();
|
||||||
#else
|
#else
|
||||||
toggle_chan_scanlist();
|
toggle_chan_scanlist();
|
||||||
#endif
|
#endif
|
||||||
g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_8: // R
|
case KEY_8: // R
|
||||||
|
|
||||||
|
if (g_scan_state_dir == SCAN_STATE_DIR_OFF)
|
||||||
|
{
|
||||||
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
g_tx_vfo->frequency_reverse = g_tx_vfo->frequency_reverse == false;
|
g_tx_vfo->frequency_reverse = g_tx_vfo->frequency_reverse == false;
|
||||||
g_request_save_channel = 1;
|
g_request_save_channel = 1;
|
||||||
// g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_9: // CALL
|
case KEY_9: // CALL
|
||||||
|
|
||||||
if (RADIO_CheckValidChannel(g_eeprom.chan_1_call, false, 0))
|
if (!RADIO_CheckValidChannel(g_eeprom.chan_1_call, false, 0))
|
||||||
{
|
{
|
||||||
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// swap to the CALL channel
|
||||||
|
|
||||||
|
MAIN_stop_scan();
|
||||||
|
|
||||||
g_eeprom.user_channel[Vfo] = g_eeprom.chan_1_call;
|
g_eeprom.user_channel[Vfo] = g_eeprom.chan_1_call;
|
||||||
g_eeprom.screen_channel[Vfo] = g_eeprom.chan_1_call;
|
g_eeprom.screen_channel[Vfo] = g_eeprom.chan_1_call;
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
AUDIO_SetVoiceID(0, VOICE_ID_CHANNEL_MODE);
|
AUDIO_SetVoiceID(0, VOICE_ID_CHANNEL_MODE);
|
||||||
AUDIO_SetDigitVoice(1, g_eeprom.chan_1_call + 1);
|
AUDIO_SetDigitVoice(1, g_eeprom.chan_1_call + 1);
|
||||||
g_another_voice_id = (voice_id_t)0xFE;
|
g_another_voice_id = (voice_id_t)0xFE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_request_save_vfo = true;
|
g_request_save_vfo = true;
|
||||||
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
|
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
g_update_status = true;
|
// g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
g_fkey_pressed = false;
|
|
||||||
g_fkey_pressed = false;
|
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
|
||||||
// if (!g_fm_radio_mode)
|
|
||||||
#endif
|
|
||||||
// g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MAIN_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
|
static void MAIN_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
|
||||||
{
|
{
|
||||||
|
g_key_input_count_down = key_input_timeout_500ms;
|
||||||
|
|
||||||
if (key_held)
|
if (key_held)
|
||||||
{ // key held down
|
{ // key held down
|
||||||
|
|
||||||
if (key_pressed)
|
if (key_pressed)
|
||||||
{
|
{ // and pressed
|
||||||
if (g_screen_to_display == DISPLAY_MAIN)
|
if (g_screen_to_display == DISPLAY_MAIN)
|
||||||
{
|
{
|
||||||
if (g_input_box_index > 0)
|
if (g_input_box_index > 0)
|
||||||
{ // delete any inputted chars
|
{ // clear the user box
|
||||||
g_input_box_index = 0;
|
g_input_box_index = 0;
|
||||||
g_request_display_screen = DISPLAY_MAIN;
|
g_request_display_screen = DISPLAY_MAIN;
|
||||||
}
|
}
|
||||||
@ -311,16 +360,28 @@ static void MAIN_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
|
|||||||
|
|
||||||
if (key_pressed)
|
if (key_pressed)
|
||||||
{ // key is pressed
|
{ // key is pressed
|
||||||
g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL; // beep when key is pressed
|
g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
||||||
return; // don't use the key till it's released
|
return; // don't use the key till it's released
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_fkey_pressed)
|
if (g_fkey_pressed)
|
||||||
{ // F-key wasn't pressed
|
{ // F-key was first pressed
|
||||||
|
processFKeyFunction(Key);
|
||||||
|
|
||||||
|
g_fkey_pressed = false;
|
||||||
|
g_update_status = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const uint8_t Vfo = g_eeprom.tx_vfo;
|
const uint8_t Vfo = g_eeprom.tx_vfo;
|
||||||
|
|
||||||
g_key_input_count_down = key_input_timeout_500ms;
|
if (g_scan_state_dir != SCAN_STATE_DIR_OFF || g_current_function == FUNCTION_TRANSMIT)
|
||||||
|
{
|
||||||
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add the digit to the channel/frequency input box
|
||||||
|
|
||||||
INPUTBOX_Append(Key);
|
INPUTBOX_Append(Key);
|
||||||
|
|
||||||
@ -415,7 +476,7 @@ static void MAIN_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
|
|||||||
|
|
||||||
SETTINGS_SaveVfoIndices();
|
SETTINGS_SaveVfoIndices();
|
||||||
|
|
||||||
RADIO_ConfigureChannel(Vfo, VFO_CONFIGURE_RELOAD);
|
RADIO_configure_channel(Vfo, VFO_CONFIGURE_RELOAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Frequency += 75; // is this meant to be rounding ?
|
// Frequency += 75; // is this meant to be rounding ?
|
||||||
@ -472,13 +533,6 @@ static void MAIN_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
|
|||||||
|
|
||||||
g_request_display_screen = DISPLAY_MAIN;
|
g_request_display_screen = DISPLAY_MAIN;
|
||||||
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_fkey_pressed = false;
|
|
||||||
g_update_status = true;
|
|
||||||
|
|
||||||
processFKeyFunction(Key);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MAIN_Key_EXIT(bool key_pressed, bool key_held)
|
static void MAIN_Key_EXIT(bool key_pressed, bool key_held)
|
||||||
@ -647,11 +701,8 @@ static void MAIN_Key_MENU(const bool key_pressed, const bool key_held)
|
|||||||
|
|
||||||
static void MAIN_Key_STAR(bool key_pressed, bool key_held)
|
static void MAIN_Key_STAR(bool key_pressed, bool key_held)
|
||||||
{
|
{
|
||||||
if (g_current_function == FUNCTION_TRANSMIT)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (g_input_box_index > 0)
|
if (g_input_box_index > 0)
|
||||||
{ // entering a frequency or DTMF string
|
{ // entering a channel, frequency or DTMF string
|
||||||
|
|
||||||
if (!key_held && key_pressed)
|
if (!key_held && key_pressed)
|
||||||
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
@ -671,6 +722,12 @@ static void MAIN_Key_STAR(bool key_pressed, bool key_held)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_scan_state_dir != SCAN_STATE_DIR_OFF || g_current_function == FUNCTION_TRANSMIT)
|
||||||
|
{ // RF scanning or TX'ing
|
||||||
|
g_beep_to_play = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (key_pressed)
|
if (key_pressed)
|
||||||
{ // just pressed
|
{ // just pressed
|
||||||
g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
g_beep_to_play = BEEP_1KHZ_60MS_OPTIONAL;
|
||||||
@ -779,7 +836,7 @@ static void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t D
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (g_scan_state_dir == SCAN_STATE_DIR_OFF)
|
if (g_scan_state_dir == SCAN_STATE_DIR_OFF)
|
||||||
{ // not scanning
|
{ // not RF scanning
|
||||||
|
|
||||||
if (IS_NOT_NOAA_CHANNEL(Channel))
|
if (IS_NOT_NOAA_CHANNEL(Channel))
|
||||||
{
|
{
|
||||||
@ -891,9 +948,9 @@ void MAIN_process_key(key_code_t key, bool key_pressed, bool key_held)
|
|||||||
{
|
{
|
||||||
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;
|
|
||||||
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;
|
||||||
|
g_ptt_was_released = true;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
29
app/menu.c
29
app/menu.c
@ -76,7 +76,7 @@
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void MENU_StartCssScan(int8_t Direction)
|
void MENU_start_css_scan(int8_t Direction)
|
||||||
{
|
{
|
||||||
g_css_scan_mode = CSS_SCAN_MODE_SCANNING;
|
g_css_scan_mode = CSS_SCAN_MODE_SCANNING;
|
||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
@ -87,10 +87,10 @@ void MENU_StartCssScan(int8_t Direction)
|
|||||||
|
|
||||||
MENU_SelectNextCode();
|
MENU_SelectNextCode();
|
||||||
|
|
||||||
g_scan_pause_10ms = scan_pause_2_10ms;
|
g_scan_pause_10ms = scan_pause_css_10ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MENU_StopCssScan(void)
|
void MENU_stop_css_scan(void)
|
||||||
{
|
{
|
||||||
g_css_scan_mode = CSS_SCAN_MODE_OFF;
|
g_css_scan_mode = CSS_SCAN_MODE_OFF;
|
||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
@ -143,6 +143,11 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
|||||||
*pMax = ARRAY_SIZE(g_sub_menu_off_on) - 1;
|
*pMax = ARRAY_SIZE(g_sub_menu_off_on) - 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MENU_SCAN_HOLD:
|
||||||
|
*pMin = 2;
|
||||||
|
*pMax = 20;
|
||||||
|
break;
|
||||||
|
|
||||||
case MENU_XB:
|
case MENU_XB:
|
||||||
*pMin = 0;
|
*pMin = 0;
|
||||||
*pMax = ARRAY_SIZE(g_sub_menu_xb) - 1;
|
*pMax = ARRAY_SIZE(g_sub_menu_xb) - 1;
|
||||||
@ -557,6 +562,10 @@ void MENU_AcceptSetting(void)
|
|||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MENU_SCAN_HOLD:
|
||||||
|
g_eeprom.scan_hold_time_500ms = g_sub_menu_selection;
|
||||||
|
break;
|
||||||
|
|
||||||
case MENU_XB:
|
case MENU_XB:
|
||||||
if (IS_NOAA_CHANNEL(g_eeprom.screen_channel[0]))
|
if (IS_NOAA_CHANNEL(g_eeprom.screen_channel[0]))
|
||||||
return;
|
return;
|
||||||
@ -882,7 +891,7 @@ void MENU_SelectNextCode(void)
|
|||||||
|
|
||||||
RADIO_setup_registers(true);
|
RADIO_setup_registers(true);
|
||||||
|
|
||||||
g_scan_pause_10ms = (g_selected_code_type == CODE_TYPE_CONTINUOUS_TONE) ? scan_pause_3_10ms : scan_pause_4_10ms;
|
g_scan_pause_10ms = (g_selected_code_type == CODE_TYPE_CONTINUOUS_TONE) ? scan_pause_ctcss_10ms : scan_pause_cdcss_10ms;
|
||||||
|
|
||||||
g_update_display = true;
|
g_update_display = true;
|
||||||
}
|
}
|
||||||
@ -1022,6 +1031,10 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
g_sub_menu_selection = (g_eeprom.dual_watch == DUAL_WATCH_OFF) ? 0 : 1;
|
g_sub_menu_selection = (g_eeprom.dual_watch == DUAL_WATCH_OFF) ? 0 : 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MENU_SCAN_HOLD:
|
||||||
|
g_sub_menu_selection = g_eeprom.scan_hold_time_500ms;
|
||||||
|
break;
|
||||||
|
|
||||||
case MENU_XB:
|
case MENU_XB:
|
||||||
g_sub_menu_selection = g_eeprom.cross_vfo_rx_tx;
|
g_sub_menu_selection = g_eeprom.cross_vfo_rx_tx;
|
||||||
break;
|
break;
|
||||||
@ -1482,7 +1495,7 @@ static void MENU_Key_EXIT(bool key_pressed, bool key_held)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MENU_StopCssScan();
|
MENU_stop_css_scan();
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
g_another_voice_id = VOICE_ID_SCANNING_STOP;
|
g_another_voice_id = VOICE_ID_SCANNING_STOP;
|
||||||
@ -1669,7 +1682,7 @@ static void MENU_Key_STAR(const bool key_pressed, const bool key_held)
|
|||||||
|
|
||||||
if (g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
if (g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
||||||
{
|
{
|
||||||
MENU_StartCssScan(1);
|
MENU_start_css_scan(1);
|
||||||
g_request_display_screen = DISPLAY_MENU;
|
g_request_display_screen = DISPLAY_MENU;
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
AUDIO_SetVoiceID(0, VOICE_ID_SCANNING_BEGIN);
|
AUDIO_SetVoiceID(0, VOICE_ID_SCANNING_BEGIN);
|
||||||
@ -1678,7 +1691,7 @@ static void MENU_Key_STAR(const bool key_pressed, const bool key_held)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MENU_StopCssScan();
|
MENU_stop_css_scan();
|
||||||
g_request_display_screen = DISPLAY_MENU;
|
g_request_display_screen = DISPLAY_MENU;
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
g_another_voice_id = VOICE_ID_SCANNING_STOP;
|
g_another_voice_id = VOICE_ID_SCANNING_STOP;
|
||||||
@ -1737,7 +1750,7 @@ static void MENU_Key_UP_DOWN(bool key_pressed, bool key_held, int8_t Direction)
|
|||||||
|
|
||||||
if (g_css_scan_mode != CSS_SCAN_MODE_OFF)
|
if (g_css_scan_mode != CSS_SCAN_MODE_OFF)
|
||||||
{
|
{
|
||||||
MENU_StartCssScan(Direction);
|
MENU_start_css_scan(Direction);
|
||||||
|
|
||||||
g_ptt_was_released = true;
|
g_ptt_was_released = true;
|
||||||
g_request_display_screen = DISPLAY_MENU;
|
g_request_display_screen = DISPLAY_MENU;
|
||||||
|
@ -27,8 +27,8 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax);
|
|||||||
void MENU_AcceptSetting(void);
|
void MENU_AcceptSetting(void);
|
||||||
void MENU_SelectNextCode(void);
|
void MENU_SelectNextCode(void);
|
||||||
void MENU_ShowCurrentSetting(void);
|
void MENU_ShowCurrentSetting(void);
|
||||||
void MENU_StartCssScan(int8_t Direction);
|
void MENU_start_css_scan(int8_t Direction);
|
||||||
void MENU_StopCssScan(void);
|
void MENU_stop_css_scan(void);
|
||||||
|
|
||||||
void MENU_process_key(key_code_t Key, bool key_pressed, bool key_held);
|
void MENU_process_key(key_code_t Key, bool key_pressed, bool key_held);
|
||||||
|
|
||||||
|
@ -334,8 +334,8 @@ static void SEARCH_Key_MENU(bool key_pressed, bool key_held)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RADIO_ConfigureChannel(0, VFO_CONFIGURE_RELOAD);
|
RADIO_configure_channel(0, VFO_CONFIGURE_RELOAD);
|
||||||
RADIO_ConfigureChannel(1, VFO_CONFIGURE_RELOAD);
|
RADIO_configure_channel(1, VFO_CONFIGURE_RELOAD);
|
||||||
|
|
||||||
g_tx_vfo->freq_config_rx.code_type = g_search_css_result_type;
|
g_tx_vfo->freq_config_rx.code_type = g_search_css_result_type;
|
||||||
g_tx_vfo->freq_config_rx.code = g_search_css_result_code;
|
g_tx_vfo->freq_config_rx.code = g_search_css_result_code;
|
||||||
|
38
bitmaps.c
38
bitmaps.c
@ -99,7 +99,7 @@ const uint8_t BITMAP_RX[8] =
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const uint8_t BITMAP_USB_C[9] =
|
const uint8_t BITMAP_USB_C[8] =
|
||||||
{ // USB symbol
|
{ // USB symbol
|
||||||
__extension__ 0b00000000,
|
__extension__ 0b00000000,
|
||||||
__extension__ 0b00011100,
|
__extension__ 0b00011100,
|
||||||
@ -107,13 +107,12 @@ const uint8_t BITMAP_USB_C[9] =
|
|||||||
__extension__ 0b01000100,
|
__extension__ 0b01000100,
|
||||||
__extension__ 0b01000100,
|
__extension__ 0b01000100,
|
||||||
__extension__ 0b01000100,
|
__extension__ 0b01000100,
|
||||||
__extension__ 0b01000100,
|
|
||||||
__extension__ 0b00100111,
|
__extension__ 0b00100111,
|
||||||
__extension__ 0b00011100
|
__extension__ 0b00011100
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t BITMAP_KEYLOCK[6] =
|
const uint8_t BITMAP_KEYLOCK[6] =
|
||||||
{ // teeny padlock symbol
|
{ // teeny weeny padlock symbol
|
||||||
__extension__ 0b00000000,
|
__extension__ 0b00000000,
|
||||||
__extension__ 0b01111100,
|
__extension__ 0b01111100,
|
||||||
__extension__ 0b01000110,
|
__extension__ 0b01000110,
|
||||||
@ -191,7 +190,7 @@ const uint8_t BITMAP_F_KEY[6] =
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const uint8_t BITMAP_TDR1[12] =
|
const uint8_t BITMAP_TDR_RUNNING[12] =
|
||||||
{ // "DW"
|
{ // "DW"
|
||||||
__extension__ 0b00000000,
|
__extension__ 0b00000000,
|
||||||
__extension__ 0b01111111,
|
__extension__ 0b01111111,
|
||||||
@ -207,20 +206,20 @@ const uint8_t BITMAP_TDR1[12] =
|
|||||||
__extension__ 0b01111111
|
__extension__ 0b01111111
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t BITMAP_TDR2[12] =
|
const uint8_t BITMAP_TDR_HOLDING[12] =
|
||||||
{ // "><" .. DW on hold
|
{ // "--" .. DW on hold
|
||||||
__extension__ 0b00000000,
|
__extension__ 0b00000000,
|
||||||
__extension__ 0b00000000,
|
__extension__ 0b00001000,
|
||||||
__extension__ 0b00100010,
|
__extension__ 0b00001000,
|
||||||
__extension__ 0b00110110,
|
__extension__ 0b00001000,
|
||||||
__extension__ 0b00011100,
|
__extension__ 0b00001000,
|
||||||
__extension__ 0b00001000,
|
__extension__ 0b00001000,
|
||||||
__extension__ 0b00000000,
|
__extension__ 0b00000000,
|
||||||
__extension__ 0b00001000,
|
__extension__ 0b00001000,
|
||||||
__extension__ 0b00011100,
|
__extension__ 0b00001000,
|
||||||
__extension__ 0b00110110,
|
__extension__ 0b00001000,
|
||||||
__extension__ 0b00100010,
|
__extension__ 0b00001000,
|
||||||
__extension__ 0b00000000
|
__extension__ 0b00001000
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
@ -238,6 +237,16 @@ const uint8_t BITMAP_TDR2[12] =
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const uint8_t BITMAP_MONITOR[6] =
|
||||||
|
{ // "M"
|
||||||
|
__extension__ 0b00000000,
|
||||||
|
__extension__ 0b01111111,
|
||||||
|
__extension__ 0b00000010,
|
||||||
|
__extension__ 0b00001100,
|
||||||
|
__extension__ 0b00000010,
|
||||||
|
__extension__ 0b01111111
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
const uint8_t BITMAP_FM[12] =
|
const uint8_t BITMAP_FM[12] =
|
||||||
{ // "FM"
|
{ // "FM"
|
||||||
@ -247,7 +256,6 @@ const uint8_t BITMAP_TDR2[12] =
|
|||||||
__extension__ 0b00001001,
|
__extension__ 0b00001001,
|
||||||
__extension__ 0b00001001,
|
__extension__ 0b00001001,
|
||||||
__extension__ 0b00000001,
|
__extension__ 0b00000001,
|
||||||
|
|
||||||
__extension__ 0b00000000,
|
__extension__ 0b00000000,
|
||||||
__extension__ 0b01111111,
|
__extension__ 0b01111111,
|
||||||
__extension__ 0b00000010,
|
__extension__ 0b00000010,
|
||||||
|
@ -10,7 +10,7 @@ extern const uint8_t BITMAP_RX[8];
|
|||||||
|
|
||||||
extern const uint8_t BITMAP_BATTERY_LEVEL[17];
|
extern const uint8_t BITMAP_BATTERY_LEVEL[17];
|
||||||
|
|
||||||
extern const uint8_t BITMAP_USB_C[9];
|
extern const uint8_t BITMAP_USB_C[8];
|
||||||
|
|
||||||
extern const uint8_t BITMAP_KEYLOCK[6];
|
extern const uint8_t BITMAP_KEYLOCK[6];
|
||||||
|
|
||||||
@ -26,13 +26,15 @@ extern const uint8_t BITMAP_F_KEY[6];
|
|||||||
extern const uint8_t BITMAP_XB[12];
|
extern const uint8_t BITMAP_XB[12];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern const uint8_t BITMAP_TDR1[12];
|
extern const uint8_t BITMAP_TDR_RUNNING[12];
|
||||||
extern const uint8_t BITMAP_TDR2[12];
|
extern const uint8_t BITMAP_TDR_HOLDING[12];
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
extern const uint8_t BITMAP_VOICE_PROMPT[9];
|
extern const uint8_t BITMAP_VOICE_PROMPT[9];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern const uint8_t BITMAP_MONITOR[6];
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
extern const uint8_t BITMAP_FM[12];
|
extern const uint8_t BITMAP_FM[12];
|
||||||
#endif
|
#endif
|
||||||
|
4
board.c
4
board.c
@ -747,6 +747,10 @@ void BOARD_EEPROM_load(void)
|
|||||||
#endif
|
#endif
|
||||||
g_setting_backlight_on_tx_rx = (Data[7] >> 6) & 3u;
|
g_setting_backlight_on_tx_rx = (Data[7] >> 6) & 3u;
|
||||||
|
|
||||||
|
// 0F48..0F4F
|
||||||
|
EEPROM_ReadBuffer(0x0F48, Data, 8);
|
||||||
|
g_eeprom.scan_hold_time_500ms = (Data[0] > 20) ? 6 : (Data[0] < 2) ? 6 : Data[0];
|
||||||
|
|
||||||
if (!g_eeprom.vfo_open)
|
if (!g_eeprom.vfo_open)
|
||||||
{
|
{
|
||||||
g_eeprom.screen_channel[0] = g_eeprom.user_channel[0];
|
g_eeprom.screen_channel[0] = g_eeprom.user_channel[0];
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
15
functions.c
15
functions.c
@ -89,11 +89,14 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
if (was_power_save && Function != FUNCTION_POWER_SAVE)
|
if (was_power_save && Function != FUNCTION_POWER_SAVE)
|
||||||
{ // wake up
|
{ // wake up
|
||||||
BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable();
|
BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable();
|
||||||
|
|
||||||
g_rx_idle_mode = false;
|
g_rx_idle_mode = false;
|
||||||
|
|
||||||
UI_DisplayStatus(false);
|
UI_DisplayStatus(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_update_status = true;
|
||||||
|
|
||||||
switch (Function)
|
switch (Function)
|
||||||
{
|
{
|
||||||
case FUNCTION_FOREGROUND:
|
case FUNCTION_FOREGROUND:
|
||||||
@ -125,7 +128,6 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
g_dtmf_auto_reset_time_500ms = g_eeprom.dtmf_auto_reset_time * 2;
|
g_dtmf_auto_reset_time_500ms = g_eeprom.dtmf_auto_reset_time * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_update_status = true;
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case FUNCTION_MONITOR:
|
case FUNCTION_MONITOR:
|
||||||
@ -165,8 +167,6 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
|
|
||||||
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_UNKNOWN, false);
|
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_UNKNOWN, false);
|
||||||
|
|
||||||
g_update_status = true;
|
|
||||||
|
|
||||||
if (g_screen_to_display != DISPLAY_MENU) // 1of11 .. don't close the menu
|
if (g_screen_to_display != DISPLAY_MENU) // 1of11 .. don't close the menu
|
||||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||||
|
|
||||||
@ -258,6 +258,13 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
if (g_setting_backlight_on_tx_rx == 1 || g_setting_backlight_on_tx_rx == 3)
|
if (g_setting_backlight_on_tx_rx == 1 || g_setting_backlight_on_tx_rx == 3)
|
||||||
backlight_turn_on(backlight_tx_rx_time_500ms);
|
backlight_turn_on(backlight_tx_rx_time_500ms);
|
||||||
|
|
||||||
|
if (g_eeprom.dual_watch != DUAL_WATCH_OFF)
|
||||||
|
{ // dual-RX is enabled
|
||||||
|
g_dual_watch_delay_10ms = dual_watch_delay_after_tx_10ms;
|
||||||
|
if (g_dual_watch_delay_10ms < (g_eeprom.scan_hold_time_500ms * 50))
|
||||||
|
g_dual_watch_delay_10ms = g_eeprom.scan_hold_time_500ms * 50;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FUNCTION_PANADAPTER:
|
case FUNCTION_PANADAPTER:
|
||||||
@ -270,4 +277,6 @@ void FUNCTION_Select(function_type_t Function)
|
|||||||
#if defined(ENABLE_FMRADIO)
|
#if defined(ENABLE_FMRADIO)
|
||||||
g_fm_restore_count_down_10ms = 0;
|
g_fm_restore_count_down_10ms = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
g_update_status = true;
|
||||||
}
|
}
|
||||||
|
4
main.c
4
main.c
@ -92,8 +92,8 @@ void Main(void)
|
|||||||
|
|
||||||
BOARD_EEPROM_LoadCalibration();
|
BOARD_EEPROM_LoadCalibration();
|
||||||
|
|
||||||
RADIO_ConfigureChannel(0, VFO_CONFIGURE_RELOAD);
|
RADIO_configure_channel(0, VFO_CONFIGURE_RELOAD);
|
||||||
RADIO_ConfigureChannel(1, VFO_CONFIGURE_RELOAD);
|
RADIO_configure_channel(1, VFO_CONFIGURE_RELOAD);
|
||||||
|
|
||||||
RADIO_select_vfos();
|
RADIO_select_vfos();
|
||||||
|
|
||||||
|
34
misc.c
34
misc.c
@ -53,23 +53,19 @@ const uint8_t key_repeat_10ms = 50 / 10; // 50ms
|
|||||||
const uint16_t scan_freq_css_timeout_10ms = 10000 / 10; // 10 seconds
|
const uint16_t scan_freq_css_timeout_10ms = 10000 / 10; // 10 seconds
|
||||||
const uint8_t scan_freq_css_delay_10ms = 210 / 10; // 210ms .. don't reduce this
|
const uint8_t scan_freq_css_delay_10ms = 210 / 10; // 210ms .. don't reduce this
|
||||||
|
|
||||||
const uint16_t dual_watch_count_after_tx_10ms = 3600 / 10; // 3.6 sec after TX ends
|
|
||||||
const uint16_t dual_watch_count_after_rx_10ms = 1000 / 10; // 1 sec after RX ends ?
|
|
||||||
const uint16_t dual_watch_count_after_1_10ms = 5000 / 10; // 5 sec
|
|
||||||
const uint16_t dual_watch_count_after_2_10ms = 3600 / 10; // 3.6 sec
|
|
||||||
const uint16_t dual_watch_count_noaa_10ms = 70 / 10; // 70ms
|
|
||||||
#ifdef ENABLE_VOX
|
#ifdef ENABLE_VOX
|
||||||
const uint16_t dual_watch_count_after_vox_10ms = 200 / 10; // 200ms
|
const uint16_t dual_watch_delay_after_vox_10ms = 200 / 10; // 200ms
|
||||||
#endif
|
#endif
|
||||||
const uint16_t dual_watch_count_toggle_10ms = 100 / 10; // 100ms between VFO toggles
|
const uint16_t dual_watch_delay_after_tx_10ms = 7000 / 10; // 7 sec after TX ends
|
||||||
|
const uint16_t dual_watch_delay_noaa_10ms = 70 / 10; // 70ms
|
||||||
|
const uint16_t dual_watch_delay_toggle_10ms = 100 / 10; // 100ms between VFO toggles
|
||||||
|
|
||||||
const uint16_t scan_pause_1_10ms = 5000 / 10; // 5 seconds
|
const uint16_t scan_pause_code_10ms = 1000 / 10; // 1 sec
|
||||||
const uint16_t scan_pause_2_10ms = 500 / 10; // 500ms
|
const uint16_t scan_pause_css_10ms = 500 / 10; // 500ms
|
||||||
const uint16_t scan_pause_3_10ms = 200 / 10; // 200ms
|
const uint16_t scan_pause_ctcss_10ms = 200 / 10; // 200ms
|
||||||
const uint16_t scan_pause_4_10ms = 300 / 10; // 300ms
|
const uint16_t scan_pause_cdcss_10ms = 300 / 10; // 300ms
|
||||||
const uint16_t scan_pause_5_10ms = 1000 / 10; // 1 sec
|
const uint16_t scan_pause_freq_10ms = 100 / 10; // 100ms
|
||||||
const uint16_t scan_pause_6_10ms = 100 / 10; // 100ms
|
const uint16_t scan_pause_chan_10ms = 200 / 10; // 200ms
|
||||||
const uint16_t scan_pause_7_10ms = 3600 / 10; // 3.6 seconds
|
|
||||||
|
|
||||||
const uint16_t battery_save_count_10ms = 10000 / 10; // 10 seconds
|
const uint16_t battery_save_count_10ms = 10000 / 10; // 10 seconds
|
||||||
|
|
||||||
@ -141,10 +137,8 @@ volatile uint16_t g_battery_save_count_down_10ms = battery_save_count_10ms;
|
|||||||
volatile bool g_power_save_expired;
|
volatile bool g_power_save_expired;
|
||||||
volatile bool g_schedule_power_save;
|
volatile bool g_schedule_power_save;
|
||||||
|
|
||||||
volatile bool g_schedule_dual_watch = true;
|
volatile uint16_t g_dual_watch_delay_10ms;
|
||||||
|
volatile bool g_dual_watch_delay_down_expired = true;
|
||||||
volatile uint16_t g_dual_watch_count_down_10ms;
|
|
||||||
volatile bool g_dual_watch_count_down_expired = true;
|
|
||||||
|
|
||||||
volatile uint8_t g_serial_config_count_down_500ms;
|
volatile uint8_t g_serial_config_count_down_500ms;
|
||||||
|
|
||||||
@ -221,10 +215,10 @@ uint16_t g_low_batteryCountdown;
|
|||||||
reception_mode_t g_rx_reception_mode;
|
reception_mode_t g_rx_reception_mode;
|
||||||
|
|
||||||
uint8_t g_scan_next_channel;
|
uint8_t g_scan_next_channel;
|
||||||
uint8_t g_scan_restore_channel;
|
|
||||||
scan_next_chan_t g_scan_current_scan_list;
|
scan_next_chan_t g_scan_current_scan_list;
|
||||||
|
uint8_t g_scan_restore_channel;
|
||||||
uint32_t g_scan_restore_frequency;
|
uint32_t g_scan_restore_frequency;
|
||||||
bool g_scan_keep_frequency;
|
//bool g_scan_keep_frequency;
|
||||||
bool g_scan_pause_mode;
|
bool g_scan_pause_mode;
|
||||||
volatile uint16_t g_scan_pause_10ms;
|
volatile uint16_t g_scan_pause_10ms;
|
||||||
scan_state_dir_t g_scan_state_dir;
|
scan_state_dir_t g_scan_state_dir;
|
||||||
|
46
misc.h
46
misc.h
@ -151,23 +151,19 @@ extern const uint16_t noaa_count_down_10ms;
|
|||||||
extern const uint16_t noaa_count_down_2_10ms;
|
extern const uint16_t noaa_count_down_2_10ms;
|
||||||
extern const uint16_t noaa_count_down_3_10ms;
|
extern const uint16_t noaa_count_down_3_10ms;
|
||||||
|
|
||||||
extern const uint16_t dual_watch_count_after_tx_10ms;
|
|
||||||
extern const uint16_t dual_watch_count_after_rx_10ms;
|
|
||||||
extern const uint16_t dual_watch_count_after_1_10ms;
|
|
||||||
extern const uint16_t dual_watch_count_after_2_10ms;
|
|
||||||
extern const uint16_t dual_watch_count_toggle_10ms;
|
|
||||||
extern const uint16_t dual_watch_count_noaa_10ms;
|
|
||||||
#ifdef ENABLE_VOX
|
#ifdef ENABLE_VOX
|
||||||
extern const uint16_t dual_watch_count_after_vox_10ms;
|
extern const uint16_t dual_watch_delay_after_vox_10ms;
|
||||||
#endif
|
#endif
|
||||||
|
extern const uint16_t dual_watch_delay_after_tx_10ms;
|
||||||
|
extern const uint16_t dual_watch_delay_toggle_10ms;
|
||||||
|
extern const uint16_t dual_watch_delay_noaa_10ms;
|
||||||
|
|
||||||
extern const uint16_t scan_pause_1_10ms;
|
extern const uint16_t scan_pause_code_10ms;
|
||||||
extern const uint16_t scan_pause_2_10ms;
|
extern const uint16_t scan_pause_css_10ms;
|
||||||
extern const uint16_t scan_pause_3_10ms;
|
extern const uint16_t scan_pause_ctcss_10ms;
|
||||||
extern const uint16_t scan_pause_4_10ms;
|
extern const uint16_t scan_pause_cdcss_10ms;
|
||||||
extern const uint16_t scan_pause_5_10ms;
|
extern const uint16_t scan_pause_freq_10ms;
|
||||||
extern const uint16_t scan_pause_6_10ms;
|
extern const uint16_t scan_pause_chan_10ms;
|
||||||
extern const uint16_t scan_pause_7_10ms;
|
|
||||||
|
|
||||||
extern const uint8_t g_mic_gain_dB_2[5];
|
extern const uint8_t g_mic_gain_dB_2[5];
|
||||||
|
|
||||||
@ -224,10 +220,8 @@ extern volatile uint16_t g_battery_save_count_down_10ms;
|
|||||||
extern volatile bool g_power_save_expired;
|
extern volatile bool g_power_save_expired;
|
||||||
extern volatile bool g_schedule_power_save;
|
extern volatile bool g_schedule_power_save;
|
||||||
|
|
||||||
extern volatile bool g_schedule_dual_watch;
|
extern volatile uint16_t g_dual_watch_delay_10ms;
|
||||||
|
extern volatile bool g_dual_watch_delay_down_expired;
|
||||||
extern volatile uint16_t g_dual_watch_count_down_10ms;
|
|
||||||
extern volatile bool g_dual_watch_count_down_expired;
|
|
||||||
|
|
||||||
extern volatile uint8_t g_serial_config_count_down_500ms;
|
extern volatile uint8_t g_serial_config_count_down_500ms;
|
||||||
|
|
||||||
@ -300,14 +294,14 @@ extern bool g_flag_end_tx;
|
|||||||
extern uint16_t g_low_batteryCountdown;
|
extern uint16_t g_low_batteryCountdown;
|
||||||
extern reception_mode_t g_rx_reception_mode;
|
extern reception_mode_t g_rx_reception_mode;
|
||||||
|
|
||||||
extern uint8_t g_scan_next_channel;
|
extern uint8_t g_scan_next_channel; //
|
||||||
extern uint8_t g_scan_restore_channel;
|
extern scan_next_chan_t g_scan_current_scan_list; //
|
||||||
extern scan_next_chan_t g_scan_current_scan_list;
|
extern uint8_t g_scan_restore_channel; // the channel we were on before starting the RF scan
|
||||||
extern uint32_t g_scan_restore_frequency;
|
extern uint32_t g_scan_restore_frequency; // the frequency we were on before starting the RF scan
|
||||||
extern bool g_scan_keep_frequency;
|
//extern bool g_scan_keep_frequency;
|
||||||
extern bool g_scan_pause_mode;
|
extern bool g_scan_pause_mode; // set if we're paused on a channel or frequency ?
|
||||||
extern volatile uint16_t g_scan_pause_10ms;
|
extern volatile uint16_t g_scan_pause_10ms; // ticks till we move to next channel/frequency
|
||||||
extern scan_state_dir_t g_scan_state_dir;
|
extern scan_state_dir_t g_scan_state_dir; // the direction we're scanning in
|
||||||
|
|
||||||
|
|
||||||
extern bool g_rx_vfo_is_active;
|
extern bool g_rx_vfo_is_active;
|
||||||
|
16
radio.c
16
radio.c
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "app/app.h"
|
||||||
#include "app/dtmf.h"
|
#include "app/dtmf.h"
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
#include "app/fm.h"
|
#include "app/fm.h"
|
||||||
@ -138,7 +139,7 @@ void RADIO_InitInfo(vfo_info_t *pInfo, const uint8_t ChannelSave, const uint32_t
|
|||||||
RADIO_ConfigureSquelchAndOutputPower(pInfo);
|
RADIO_ConfigureSquelchAndOutputPower(pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure)
|
void RADIO_configure_channel(const unsigned int VFO, const unsigned int configure)
|
||||||
{
|
{
|
||||||
uint8_t Channel;
|
uint8_t Channel;
|
||||||
uint8_t Attributes;
|
uint8_t Attributes;
|
||||||
@ -621,7 +622,7 @@ void RADIO_select_vfos(void)
|
|||||||
RADIO_SelectCurrentVfo();
|
RADIO_SelectCurrentVfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RADIO_setup_registers(bool switch_to_function_0)
|
void RADIO_setup_registers(bool switch_to_function_foreground)
|
||||||
{
|
{
|
||||||
BK4819_filter_bandwidth_t Bandwidth = g_rx_vfo->channel_bandwidth;
|
BK4819_filter_bandwidth_t Bandwidth = g_rx_vfo->channel_bandwidth;
|
||||||
uint16_t interrupt_mask;
|
uint16_t interrupt_mask;
|
||||||
@ -822,9 +823,14 @@ void RADIO_setup_registers(bool switch_to_function_0)
|
|||||||
|
|
||||||
FUNCTION_Init();
|
FUNCTION_Init();
|
||||||
|
|
||||||
if (switch_to_function_0)
|
if (switch_to_function_foreground)
|
||||||
|
{
|
||||||
|
if (g_monitor_enabled)
|
||||||
|
APP_start_listening(FUNCTION_MONITOR, false);
|
||||||
|
else
|
||||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
void RADIO_ConfigureNOAA(void)
|
void RADIO_ConfigureNOAA(void)
|
||||||
@ -975,10 +981,6 @@ void RADIO_PrepareTX(void)
|
|||||||
|
|
||||||
if (g_eeprom.dual_watch != DUAL_WATCH_OFF)
|
if (g_eeprom.dual_watch != DUAL_WATCH_OFF)
|
||||||
{ // dual-RX is enabled
|
{ // dual-RX is enabled
|
||||||
|
|
||||||
g_dual_watch_count_down_10ms = dual_watch_count_after_tx_10ms;
|
|
||||||
g_schedule_dual_watch = false;
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (g_rx_vfo_is_active)
|
if (g_rx_vfo_is_active)
|
||||||
{ // use the TX vfo
|
{ // use the TX vfo
|
||||||
|
4
radio.h
4
radio.h
@ -129,11 +129,11 @@ extern vfo_state_t g_vfo_state[2];
|
|||||||
bool RADIO_CheckValidChannel(uint16_t ChNum, bool bCheckScanList, uint8_t RadioNum);
|
bool RADIO_CheckValidChannel(uint16_t ChNum, bool bCheckScanList, uint8_t RadioNum);
|
||||||
uint8_t RADIO_FindNextChannel(uint8_t ChNum, scan_state_dir_t Direction, bool bCheckScanList, uint8_t RadioNum);
|
uint8_t RADIO_FindNextChannel(uint8_t ChNum, scan_state_dir_t Direction, bool bCheckScanList, uint8_t RadioNum);
|
||||||
void RADIO_InitInfo(vfo_info_t *pInfo, const uint8_t ChannelSave, const uint32_t Frequency);
|
void RADIO_InitInfo(vfo_info_t *pInfo, const uint8_t ChannelSave, const uint32_t Frequency);
|
||||||
void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure);
|
void RADIO_configure_channel(const unsigned int VFO, const unsigned int configure);
|
||||||
void RADIO_ConfigureSquelchAndOutputPower(vfo_info_t *pInfo);
|
void RADIO_ConfigureSquelchAndOutputPower(vfo_info_t *pInfo);
|
||||||
void RADIO_ApplyOffset(vfo_info_t *pInfo);
|
void RADIO_ApplyOffset(vfo_info_t *pInfo);
|
||||||
void RADIO_select_vfos(void);
|
void RADIO_select_vfos(void);
|
||||||
void RADIO_setup_registers(bool switch_to_function_0);
|
void RADIO_setup_registers(bool switch_to_function_foreground);
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
void RADIO_ConfigureNOAA(void);
|
void RADIO_ConfigureNOAA(void);
|
||||||
#endif
|
#endif
|
||||||
|
@ -78,9 +78,10 @@ void SystickHandler(void)
|
|||||||
if (g_current_function == FUNCTION_POWER_SAVE)
|
if (g_current_function == FUNCTION_POWER_SAVE)
|
||||||
DECREMENT_AND_TRIGGER(g_power_save_10ms, g_power_save_expired);
|
DECREMENT_AND_TRIGGER(g_power_save_10ms, g_power_save_expired);
|
||||||
|
|
||||||
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF && g_eeprom.dual_watch != DUAL_WATCH_OFF)
|
if (g_eeprom.dual_watch != DUAL_WATCH_OFF)
|
||||||
if (g_current_function != FUNCTION_MONITOR && g_current_function != FUNCTION_TRANSMIT && g_current_function != FUNCTION_RECEIVE)
|
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF)
|
||||||
DECREMENT_AND_TRIGGER(g_dual_watch_count_down_10ms, g_schedule_dual_watch);
|
if (g_current_function == FUNCTION_FOREGROUND || g_current_function == FUNCTION_POWER_SAVE)
|
||||||
|
DECREMENT(g_dual_watch_delay_10ms);
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF && g_eeprom.dual_watch == DUAL_WATCH_OFF)
|
if (g_scan_state_dir == SCAN_STATE_DIR_OFF && g_css_scan_mode == CSS_SCAN_MODE_OFF && g_eeprom.dual_watch == DUAL_WATCH_OFF)
|
||||||
|
@ -329,8 +329,11 @@ void SETTINGS_SaveSettings(void)
|
|||||||
if (!g_setting_am_fix) State[7] &= ~(1u << 5);
|
if (!g_setting_am_fix) State[7] &= ~(1u << 5);
|
||||||
#endif
|
#endif
|
||||||
State[7] = (State[7] & ~(3u << 6)) | ((g_setting_backlight_on_tx_rx & 3u) << 6);
|
State[7] = (State[7] & ~(3u << 6)) | ((g_setting_backlight_on_tx_rx & 3u) << 6);
|
||||||
|
|
||||||
EEPROM_WriteBuffer(0x0F40, State);
|
EEPROM_WriteBuffer(0x0F40, State);
|
||||||
|
|
||||||
|
memset(State, 0xFF, sizeof(State));
|
||||||
|
State[0] = g_eeprom.scan_hold_time_500ms;
|
||||||
|
EEPROM_WriteBuffer(0x0F48, State);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const vfo_info_t *pVFO, uint8_t Mode)
|
void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const vfo_info_t *pVFO, uint8_t Mode)
|
||||||
|
@ -404,7 +404,9 @@ typedef struct {
|
|||||||
uint8_t am_fix:1; // 1 = RX AM fix
|
uint8_t am_fix:1; // 1 = RX AM fix
|
||||||
uint8_t backlight_on_tx_rx:2; // 0 = no backlight when TX/RX, 1 = when TX, 2 = when RX, 3 = both RX/TX
|
uint8_t backlight_on_tx_rx:2; // 0 = no backlight when TX/RX, 1 = when TX, 2 = when RX, 3 = both RX/TX
|
||||||
|
|
||||||
uint8_t unused12[8]; // 0xff's
|
uint8_t scan_hold_time; //
|
||||||
|
|
||||||
|
uint8_t unused12[7]; // 0xff's
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// 0x0F50
|
// 0x0F50
|
||||||
@ -526,6 +528,8 @@ typedef struct {
|
|||||||
uint16_t vox1_threshold;
|
uint16_t vox1_threshold;
|
||||||
uint16_t vox0_threshold;
|
uint16_t vox0_threshold;
|
||||||
|
|
||||||
|
uint8_t scan_hold_time_500ms;
|
||||||
|
|
||||||
// uint8_t field29_0x26;
|
// uint8_t field29_0x26;
|
||||||
// uint8_t field30_0x27;
|
// uint8_t field30_0x27;
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ const t_menu_item g_menu_list[] =
|
|||||||
{"Tx TO", VOICE_ID_TRANSMIT_OVER_TIME, MENU_TOT }, // was "TOT"
|
{"Tx TO", VOICE_ID_TRANSMIT_OVER_TIME, MENU_TOT }, // was "TOT"
|
||||||
{"Tx VFO", VOICE_ID_INVALID, MENU_XB }, // was "WX"
|
{"Tx VFO", VOICE_ID_INVALID, MENU_XB }, // was "WX"
|
||||||
{"Dual W", VOICE_ID_DUAL_STANDBY, MENU_TDR }, // was "TDR"
|
{"Dual W", VOICE_ID_DUAL_STANDBY, MENU_TDR }, // was "TDR"
|
||||||
|
{"S HOLD", VOICE_ID_INVALID, MENU_SCAN_HOLD },
|
||||||
{"SCRAM", VOICE_ID_SCRAMBLER_ON, MENU_SCR }, // was "SCR"
|
{"SCRAM", VOICE_ID_SCRAMBLER_ON, MENU_SCR }, // was "SCR"
|
||||||
{"BCL", VOICE_ID_BUSY_LOCKOUT, MENU_BCL },
|
{"BCL", VOICE_ID_BUSY_LOCKOUT, MENU_BCL },
|
||||||
{"CH SAV", VOICE_ID_MEMORY_CHANNEL, MENU_MEM_CH }, // was "MEM-CH"
|
{"CH SAV", VOICE_ID_MEMORY_CHANNEL, MENU_MEM_CH }, // was "MEM-CH"
|
||||||
@ -853,6 +854,11 @@ void UI_DisplayMenu(void)
|
|||||||
strcpy(String, g_sub_menu_off_on[g_sub_menu_selection]);
|
strcpy(String, g_sub_menu_off_on[g_sub_menu_selection]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MENU_SCAN_HOLD:
|
||||||
|
strcpy(String, "SCAN HOLD\n");
|
||||||
|
sprintf(String + strlen(String), "%d.%d sec", g_sub_menu_selection / 2, 5 * (g_sub_menu_selection % 2));
|
||||||
|
break;
|
||||||
|
|
||||||
case MENU_XB:
|
case MENU_XB:
|
||||||
strcpy(String, g_sub_menu_xb[g_sub_menu_selection]);
|
strcpy(String, g_sub_menu_xb[g_sub_menu_selection]);
|
||||||
break;
|
break;
|
||||||
|
@ -53,6 +53,7 @@ enum
|
|||||||
MENU_TOT,
|
MENU_TOT,
|
||||||
MENU_XB,
|
MENU_XB,
|
||||||
MENU_TDR,
|
MENU_TDR,
|
||||||
|
MENU_SCAN_HOLD,
|
||||||
MENU_SCR,
|
MENU_SCR,
|
||||||
MENU_BCL,
|
MENU_BCL,
|
||||||
MENU_MEM_CH,
|
MENU_MEM_CH,
|
||||||
|
29
ui/status.c
29
ui/status.c
@ -23,6 +23,7 @@
|
|||||||
#include "bitmaps.h"
|
#include "bitmaps.h"
|
||||||
#include "driver/keyboard.h"
|
#include "driver/keyboard.h"
|
||||||
#include "driver/st7565.h"
|
#include "driver/st7565.h"
|
||||||
|
#include "app/dtmf.h"
|
||||||
#include "external/printf/printf.h"
|
#include "external/printf/printf.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
#include "helper/battery.h"
|
#include "helper/battery.h"
|
||||||
@ -135,19 +136,29 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
// DUAL-WATCH indicator
|
// DUAL-WATCH indicator
|
||||||
if (g_eeprom.dual_watch != DUAL_WATCH_OFF || test_display)
|
if (g_eeprom.dual_watch != DUAL_WATCH_OFF || test_display)
|
||||||
{
|
{
|
||||||
if (g_scan_state_dir == SCAN_STATE_DIR_OFF ||
|
if (g_dual_watch_delay_10ms > dual_watch_delay_toggle_10ms ||
|
||||||
g_squelch_lost ||
|
g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
|
||||||
g_current_function == FUNCTION_INCOMING ||
|
g_scan_state_dir != SCAN_STATE_DIR_OFF ||
|
||||||
g_current_function == FUNCTION_MONITOR ||
|
g_css_scan_mode != CSS_SCAN_MODE_OFF ||
|
||||||
g_screen_to_display == DISPLAY_SEARCH ||
|
(g_current_function != FUNCTION_FOREGROUND && g_current_function != FUNCTION_POWER_SAVE) ||
|
||||||
test_display)
|
g_screen_to_display == DISPLAY_SEARCH)
|
||||||
{
|
{
|
||||||
memmove(line + x, BITMAP_TDR1, sizeof(BITMAP_TDR1)); // dual-watch is paused
|
memmove(line + x, BITMAP_TDR_HOLDING, sizeof(BITMAP_TDR_HOLDING));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
memmove(line + x, BITMAP_TDR2, sizeof(BITMAP_TDR2)); // dual-watch is running
|
{
|
||||||
|
memmove(line + x, BITMAP_TDR_RUNNING, sizeof(BITMAP_TDR_RUNNING));
|
||||||
}
|
}
|
||||||
x += sizeof(BITMAP_TDR1);
|
x1 = x + sizeof(BITMAP_TDR_RUNNING);
|
||||||
|
}
|
||||||
|
x += sizeof(BITMAP_TDR_RUNNING);
|
||||||
|
|
||||||
|
if (g_current_function == FUNCTION_MONITOR)
|
||||||
|
{
|
||||||
|
memmove(line + x, BITMAP_MONITOR, sizeof(BITMAP_MONITOR));
|
||||||
|
x1 = x + sizeof(BITMAP_MONITOR);
|
||||||
|
}
|
||||||
|
x += sizeof(BITMAP_MONITOR);
|
||||||
|
|
||||||
// CROSS-VFO indicator
|
// CROSS-VFO indicator
|
||||||
if (g_eeprom.cross_vfo_rx_tx != CROSS_BAND_OFF || test_display)
|
if (g_eeprom.cross_vfo_rx_tx != CROSS_BAND_OFF || test_display)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user