0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-18 22:29:50 +03:00

modulation mode constants

This commit is contained in:
OneOfEleven
2023-11-06 14:46:39 +00:00
parent 1ee2662f78
commit be787babf2
12 changed files with 55 additions and 49 deletions

View File

@ -88,7 +88,7 @@ static void APP_update_rssi(const int vfo)
#ifdef ENABLE_AM_FIX
// add RF gain adjust compensation
if (g_current_vfo->channel.am_mode > 0 && g_eeprom.config.setting.am_fix)
if (g_current_vfo->channel.mod_mode != MOD_MODE_FM && g_eeprom.config.setting.am_fix)
rssi -= rssi_gain_diff[vfo];
#endif
@ -527,7 +527,7 @@ bool APP_start_listening(void)
}
// AF gain - original QS values
// if (g_rx_vfo->channel.am_mode > 0)
// if (g_rx_vfo->channel.mod_mode != MOD_MODE_FM)
// {
// BK4819_write_reg(0x48, 0xB3A8); // 1011 0011 1010 1000
// }
@ -550,12 +550,12 @@ bool APP_start_listening(void)
#ifdef ENABLE_VOICE
#ifdef MUTE_AUDIO_FOR_VOICE
if (g_voice_write_index == 0)
AUDIO_set_mod_mode(g_rx_vfo->channel.am_mode);
AUDIO_set_mod_mode(g_rx_vfo->channel.mod_mode);
#else
AUDIO_set_mod_mode(g_rx_vfo->channel.am_mode);
AUDIO_set_mod_mode(g_rx_vfo->channel.mod_mode);
#endif
#else
AUDIO_set_mod_mode(g_rx_vfo->channel.am_mode);
AUDIO_set_mod_mode(g_rx_vfo->channel.mod_mode);
#endif
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
@ -2385,7 +2385,7 @@ void APP_time_slice_10ms(void)
#endif
#ifdef ENABLE_AM_FIX
if (g_rx_vfo->channel.am_mode > 0 && g_eeprom.config.setting.am_fix)
if (g_rx_vfo->channel.mod_mode != MOD_MODE_FM && g_eeprom.config.setting.am_fix)
AM_fix_10ms(g_rx_vfo_num);
#endif

View File

@ -213,12 +213,8 @@ void processFKeyFunction(const key_code_t Key)
if (g_fkey_pressed)
{
#if 0
g_tx_vfo->channel.am_mode = (g_tx_vfo->am_mode + 1) & 1u;
#else
if (++g_tx_vfo->channel.am_mode >= 3)
g_tx_vfo->channel.am_mode = 0;
#endif
if (++g_tx_vfo->channel.mod_mode >= MOD_MODE_LEN)
g_tx_vfo->channel.mod_mode = 0;
g_request_save_channel = 1;
}
else

View File

@ -767,7 +767,7 @@ void MENU_AcceptSetting(void)
break;
case MENU_MOD_MODE:
g_tx_vfo->channel.am_mode = g_sub_menu_selection;
g_tx_vfo->channel.mod_mode = g_sub_menu_selection;
g_request_save_channel = 1;
return;
/*
@ -1234,7 +1234,7 @@ void MENU_ShowCurrentSetting(void)
break;
case MENU_MOD_MODE:
g_sub_menu_selection = g_tx_vfo->channel.am_mode;
g_sub_menu_selection = g_tx_vfo->channel.mod_mode;
break;
/*
#ifdef ENABLE_AM_FIX
@ -1765,7 +1765,7 @@ static void MENU_Key_STAR(const bool key_pressed, const bool key_held)
RADIO_select_vfos();
if (IS_NOT_NOAA_CHANNEL(g_rx_vfo->channel_save) && g_rx_vfo->channel.am_mode == 0)
if (IS_NOT_NOAA_CHANNEL(g_rx_vfo->channel_save) && g_rx_vfo->channel.mod_mode == MOD_MODE_FM)
{
if (g_menu_cursor == MENU_RX_CTCSS || g_menu_cursor == MENU_RX_CDCSS)
{ // scan CTCSS or DCS to find the tone/code of the incoming signal