mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 06:39:49 +03:00
MDC1200 update
This commit is contained in:
39
app/app.c
39
app/app.c
@ -51,6 +51,9 @@
|
||||
#include "frequencies.h"
|
||||
#include "functions.h"
|
||||
#include "helper/battery.h"
|
||||
#ifdef ENABLE_MDC1200
|
||||
#include "mdc1200.h"
|
||||
#endif
|
||||
#include "misc.h"
|
||||
#include "radio.h"
|
||||
#include "settings.h"
|
||||
@ -244,7 +247,7 @@ static void APP_process_rx(void)
|
||||
goto Skip;
|
||||
}
|
||||
|
||||
if (g_scan_state_dir != SCAN_STATE_DIR_OFF) // && IS_FREQ_CHANNEL(g_scan_next_channel))
|
||||
if (g_scan_state_dir != SCAN_STATE_DIR_OFF) // && IS_FREQ_CHANNEL(g_scan_next_channel))
|
||||
{
|
||||
if (g_squelch_open)
|
||||
{
|
||||
@ -262,7 +265,7 @@ static void APP_process_rx(void)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Mode = END_OF_RX_MODE_END;
|
||||
goto Skip;
|
||||
}
|
||||
@ -363,7 +366,7 @@ static void APP_process_rx(void)
|
||||
{
|
||||
Mode = END_OF_RX_MODE_END;
|
||||
}
|
||||
|
||||
|
||||
if (!g_end_of_rx_detected_maybe &&
|
||||
Mode == END_OF_RX_MODE_NONE &&
|
||||
g_next_time_slice_40ms &&
|
||||
@ -397,7 +400,7 @@ Skip:
|
||||
break;
|
||||
|
||||
case END_OF_RX_MODE_TTE:
|
||||
|
||||
|
||||
if (g_eeprom.tail_note_elimination)
|
||||
{
|
||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||
@ -407,7 +410,7 @@ Skip:
|
||||
g_end_of_rx_detected_maybe = true;
|
||||
g_speaker_enabled = false;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -487,6 +490,10 @@ bool APP_start_listening(function_type_t Function, const bool reset_am_fix)
|
||||
BK1080_Init(0, false);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MDC1200
|
||||
MDC1200_reset_rx();
|
||||
#endif
|
||||
|
||||
// clear the other vfo's rssi level (to hide the antenna symbol)
|
||||
g_vfo_rssi_bar_level[(chan + 1) & 1u] = 0;
|
||||
|
||||
@ -602,7 +609,7 @@ bool APP_start_listening(function_type_t Function, const bool reset_am_fix)
|
||||
g_update_display = true;
|
||||
|
||||
g_update_status = true;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1191,15 +1198,15 @@ void APP_process(void)
|
||||
g_rx_reception_mode = RX_MODE_NONE;
|
||||
|
||||
if (g_scan_next_channel <= USER_CHANNEL_LAST)
|
||||
APP_next_channel();
|
||||
APP_next_channel();
|
||||
else
|
||||
if (IS_FREQ_CHANNEL(g_scan_next_channel))
|
||||
APP_next_freq();
|
||||
APP_next_freq();
|
||||
}
|
||||
/*
|
||||
if (g_scan_next_channel <= USER_CHANNEL_LAST)
|
||||
{ // channel mode
|
||||
|
||||
|
||||
if (g_current_code_type == CODE_TYPE_NONE && g_current_function == FUNCTION_NEW_RECEIVE && !g_scan_pause_time_mode)
|
||||
{
|
||||
APP_start_listening(g_monitor_enabled ? FUNCTION_MONITOR : FUNCTION_RECEIVE, true);
|
||||
@ -1208,13 +1215,13 @@ void APP_process(void)
|
||||
{ // switch to next channel
|
||||
g_scan_pause_time_mode = false;
|
||||
g_rx_reception_mode = RX_MODE_NONE;
|
||||
APP_next_channel();
|
||||
APP_next_channel();
|
||||
}
|
||||
}
|
||||
else
|
||||
if (IS_FREQ_CHANNEL(g_scan_next_channel))
|
||||
{ // frequency mode
|
||||
|
||||
|
||||
if (g_current_function == FUNCTION_NEW_RECEIVE && !g_scan_pause_time_mode)
|
||||
{
|
||||
APP_start_listening(g_monitor_enabled ? FUNCTION_MONITOR : FUNCTION_RECEIVE, true);
|
||||
@ -1223,7 +1230,7 @@ void APP_process(void)
|
||||
{ // switch to next frequency
|
||||
g_scan_pause_time_mode = false;
|
||||
g_rx_reception_mode = RX_MODE_NONE;
|
||||
APP_next_freq();
|
||||
APP_next_freq();
|
||||
}
|
||||
}
|
||||
*/
|
||||
@ -1797,7 +1804,7 @@ void APP_time_slice_10ms(void)
|
||||
RADIO_enableTX(false);
|
||||
BK4819_TransmitTone(true, 500);
|
||||
SYSTEM_DelayMs(2);
|
||||
|
||||
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||
g_speaker_enabled = true;
|
||||
|
||||
@ -2435,7 +2442,7 @@ void APP_time_slice_500ms(void)
|
||||
RADIO_tx_eot();
|
||||
RADIO_EnableCxCSS();
|
||||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_VOX
|
||||
g_vox_resume_count_down = 80;
|
||||
#endif
|
||||
@ -2464,7 +2471,7 @@ void APP_channel_next(const bool remember_current, const scan_state_dir_t scan_d
|
||||
g_scan_restore_channel = 0xff;
|
||||
g_scan_restore_frequency = 0xffffffff;
|
||||
}
|
||||
|
||||
|
||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||
UART_printf("APP_channel_next %u\r\n", g_scan_next_channel);
|
||||
#endif
|
||||
@ -2476,7 +2483,7 @@ void APP_channel_next(const bool remember_current, const scan_state_dir_t scan_d
|
||||
APP_next_channel();
|
||||
}
|
||||
else
|
||||
if (IS_FREQ_CHANNEL(g_scan_next_channel))
|
||||
if (IS_FREQ_CHANNEL(g_scan_next_channel))
|
||||
{ // frequency mode
|
||||
if (remember_current)
|
||||
g_scan_restore_frequency = g_rx_vfo->freq_config_rx.frequency;
|
||||
|
18
app/menu.c
18
app/menu.c
@ -145,8 +145,8 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
||||
break;
|
||||
|
||||
case MENU_SCAN_HOLD:
|
||||
*pMin = 2;
|
||||
*pMax = 20; // 10 seconds
|
||||
*pMin = 2; // 1 second
|
||||
*pMax = 40; // 20 seconds
|
||||
break;
|
||||
|
||||
case MENU_CROSS_VFO:
|
||||
@ -330,6 +330,11 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_MDC1200
|
||||
case MENU_MDC1200_MODE:
|
||||
*pMin = 0;
|
||||
*pMax = ARRAY_SIZE(g_sub_menu_mdc1200_mode) - 1;
|
||||
break;
|
||||
|
||||
case MENU_MDC1200_ID:
|
||||
*pMin = 0;
|
||||
*pMax = 0xffff;
|
||||
@ -711,6 +716,11 @@ void MENU_AcceptSetting(void)
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_MDC1200
|
||||
case MENU_MDC1200_MODE:
|
||||
g_tx_vfo->mdc1200_mode = g_sub_menu_selection;
|
||||
g_request_save_channel = 1;
|
||||
break;
|
||||
|
||||
case MENU_MDC1200_ID:
|
||||
g_eeprom.mdc1200_id = g_sub_menu_selection;
|
||||
break;
|
||||
@ -1213,6 +1223,10 @@ void MENU_ShowCurrentSetting(void)
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_MDC1200
|
||||
case MENU_MDC1200_MODE:
|
||||
g_sub_menu_selection = g_tx_vfo->mdc1200_mode;
|
||||
break;
|
||||
|
||||
case MENU_MDC1200_ID:
|
||||
g_sub_menu_selection = g_eeprom.mdc1200_id;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user