0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 14:48:03 +03:00

fix missing display details

This commit is contained in:
OneOfEleven
2023-11-02 21:44:53 +00:00
parent 3681674b09
commit 98a4cd9483
20 changed files with 401 additions and 444 deletions

View File

@ -76,11 +76,11 @@ static void ACTION_FlashLight(void)
void ACTION_Power(void)
{
if (++g_tx_vfo->output_power > OUTPUT_POWER_HIGH)
g_tx_vfo->output_power = OUTPUT_POWER_LOW;
if (++g_tx_vfo->channel.tx_power > OUTPUT_POWER_HIGH)
g_tx_vfo->channel.tx_power = OUTPUT_POWER_LOW;
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
// UART_printf("act_pwr %u\r\n", g_tx_vfo->output_power);
// UART_printf("act_pwr %u\r\n", g_tx_vfo->channel.tx_power);
#endif
g_request_save_channel = 1;

View File

@ -83,7 +83,7 @@ static void APP_update_rssi(const int vfo)
#ifdef ENABLE_AM_FIX
// add RF gain adjust compensation
if (g_current_vfo->am_mode > 0 && g_eeprom.config.setting.am_fix)
if (g_current_vfo->channel.am_mode > 0 && g_eeprom.config.setting.am_fix)
rssi -= rssi_gain_diff[vfo];
#endif
@ -214,9 +214,9 @@ static void APP_process_new_receive(void)
{ // not code scanning
#ifdef ENABLE_KILL_REVIVE
if (g_rx_vfo->dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
if (g_rx_vfo->channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
#else
if (g_rx_vfo->dtmf_decoding_enable)
if (g_rx_vfo->channel.dtmf_decoding_enable)
#endif
{ // DTMF DCD is enabled
@ -520,7 +520,7 @@ bool APP_start_listening(void)
}
// AF gain - original QS values
// if (g_rx_vfo->am_mode > 0)
// if (g_rx_vfo->channel.am_mode > 0)
// {
// BK4819_WriteRegister(0x48, 0xB3A8); // 1011 0011 1010 1000
// }
@ -540,12 +540,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->am_mode);
AUDIO_set_mod_mode(g_rx_vfo->channel.am_mode);
#else
AUDIO_set_mod_mode(g_rx_vfo->am_mode);
AUDIO_set_mod_mode(g_rx_vfo->channel.am_mode);
#endif
#else
AUDIO_set_mod_mode(g_rx_vfo->am_mode);
AUDIO_set_mod_mode(g_rx_vfo->channel.am_mode);
#endif
#ifdef ENABLE_FMRADIO
@ -568,7 +568,7 @@ uint32_t APP_set_frequency_by_step(vfo_info_t *pInfo, int8_t Step)
if (pInfo->step_freq == 833)
{
const uint32_t Lower = FREQ_BAND_TABLE[pInfo->band].lower;
const uint32_t Lower = FREQ_BAND_TABLE[pInfo->channel_attributes.band].lower;
const uint32_t Delta = Frequency - Lower;
uint32_t Base = (Delta / 2500) * 2500;
const uint32_t Index = ((Delta - Base) % 2500) / 833;
@ -579,12 +579,12 @@ uint32_t APP_set_frequency_by_step(vfo_info_t *pInfo, int8_t Step)
Frequency = Lower + Base + (Index * 833);
}
// if (Frequency >= FREQ_BAND_TABLE[pInfo->band].upper)
// Frequency = FREQ_BAND_TABLE[pInfo->band].lower;
// if (Frequency >= FREQ_BAND_TABLE[pInfo->channel_attributes.band].upper)
// Frequency = FREQ_BAND_TABLE[pInfo->channel_attributes.band].lower;
// else
// if (Frequency < FREQ_BAND_TABLE[pInfo->band].lower)
// Frequency = FREQUENCY_floor_to_step(FREQ_BAND_TABLE[pInfo->band].upper, pInfo->step_freq, FREQ_BAND_TABLE[pInfo->band].lower);
Frequency = FREQUENCY_wrap_to_step_band(Frequency, pInfo->step_freq, pInfo->band);
// if (Frequency < FREQ_BAND_TABLE[pInfo->channel_attributes.band].lower)
// Frequency = FREQUENCY_floor_to_step(FREQ_BAND_TABLE[pInfo->channel_attributes.band].upper, pInfo->step_freq, FREQ_BAND_TABLE[pInfo->channel_attributes.band].lower);
Frequency = FREQUENCY_wrap_to_step_band(Frequency, pInfo->step_freq, pInfo->channel_attributes.band);
return Frequency;
}
@ -940,9 +940,9 @@ void APP_process_radio_interrupts(void)
}
#ifdef ENABLE_KILL_REVIVE
if (g_rx_vfo->dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
if (g_rx_vfo->channel.dtmf_decoding_enable || g_eeprom.config.setting.radio_disabled)
#else
if (g_rx_vfo->dtmf_decoding_enable)
if (g_rx_vfo->channel.dtmf_decoding_enable)
#endif
{
if (g_dtmf_rx_index >= (sizeof(g_dtmf_rx) - 1))
@ -2321,7 +2321,7 @@ void APP_time_slice_10ms(void)
#endif
#ifdef ENABLE_AM_FIX
if (g_rx_vfo->am_mode > 0 && g_eeprom.config.setting.am_fix)
if (g_rx_vfo->channel.am_mode > 0 && g_eeprom.config.setting.am_fix)
AM_fix_10ms(g_rx_vfo_num);
#endif
@ -2686,10 +2686,10 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
BK4819_ExitDTMF_TX(false);
if (g_current_vfo->scrambling_type == 0 || !g_eeprom.config.setting.enable_scrambler)
if (g_current_vfo->channel.scrambler == 0 || !g_eeprom.config.setting.enable_scrambler)
BK4819_DisableScramble();
else
BK4819_EnableScramble(g_current_vfo->scrambling_type - 1);
BK4819_EnableScramble(g_current_vfo->channel.scrambler - 1);
}
}
else

View File

@ -27,6 +27,7 @@
#include "dtmf.h"
#include "external/printf/printf.h"
#include "misc.h"
#include "radio.h"
#include "settings.h"
#include "ui/ui.h"
@ -214,9 +215,9 @@ void DTMF_HandleRequest(void)
}
#ifdef ENABLE_KILL_REVIVE
if (!g_rx_vfo->dtmf_decoding_enable && !g_eeprom.config.setting.radio_disabled)
if (!g_rx_vfo->channel.dtmf_decoding_enable && !g_eeprom.config.setting.radio_disabled)
#else
if (!g_rx_vfo->dtmf_decoding_enable)
if (!g_rx_vfo->channel.dtmf_decoding_enable)
#endif
{ // D-DCD is disabled or we're enabled
DTMF_clear_RX();
@ -417,9 +418,9 @@ bool DTMF_Reply(void)
default:
case DTMF_REPLY_NONE:
if (g_dtmf_call_state != DTMF_CALL_STATE_NONE ||
g_current_vfo->dtmf_ptt_id_tx_mode == PTT_ID_APOLLO ||
g_current_vfo->dtmf_ptt_id_tx_mode == PTT_ID_OFF ||
g_current_vfo->dtmf_ptt_id_tx_mode == PTT_ID_TX_DOWN)
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO ||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_OFF ||
g_current_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_TX_DOWN)
{
g_dtmf_reply_state = DTMF_REPLY_NONE;
return false;

View File

@ -219,7 +219,7 @@ void GENERIC_Key_PTT(bool key_pressed)
#else
// append our DTMF ID to the inputted DTMF code -
// IF the user inputted code is exactly 3 digits long and D-DCD is enabled
if (g_dtmf_input_box_index == 3 && g_tx_vfo->dtmf_decoding_enable > 0)
if (g_dtmf_input_box_index == 3 && g_tx_vfo->channel.dtmf_decoding_enable > 0)
g_dtmf_call_mode = DTMF_CheckGroupCall(g_dtmf_input_box, 3);
else
g_dtmf_call_mode = DTMF_CALL_MODE_DTMF;

View File

@ -80,19 +80,19 @@ void toggle_chan_scanlist(void)
return;
}
if (g_tx_vfo->scanlist_1_participation)
if (g_tx_vfo->channel_attributes.scanlist1)
{
if (g_tx_vfo->scanlist_2_participation)
g_tx_vfo->scanlist_1_participation = 0;
if (g_tx_vfo->channel_attributes.scanlist2)
g_tx_vfo->channel_attributes.scanlist1 = 0;
else
g_tx_vfo->scanlist_2_participation = 1;
g_tx_vfo->channel_attributes.scanlist2 = 1;
}
else
{
if (g_tx_vfo->scanlist_2_participation)
g_tx_vfo->scanlist_2_participation = 0;
if (g_tx_vfo->channel_attributes.scanlist2)
g_tx_vfo->channel_attributes.scanlist2 = 0;
else
g_tx_vfo->scanlist_1_participation = 1;
g_tx_vfo->channel_attributes.scanlist1 = 1;
}
SETTINGS_save_chan_attribs_name(g_tx_vfo->channel_save, g_tx_vfo);
@ -122,7 +122,7 @@ void toggle_chan_scanlist(void)
if (IS_USER_CHANNEL(g_eeprom.config.setting.indices.vfo[vfo].screen))
{ // copy channel to VFO, then swap to the VFO
const unsigned int channel = FREQ_CHANNEL_FIRST + g_vfo_info[vfo].band;
const unsigned int channel = FREQ_CHANNEL_FIRST + g_vfo_info[vfo].channel_attributes.band;
g_eeprom.config.setting.indices.vfo[vfo].screen = channel;
g_vfo_info[vfo].channel_save = channel;
@ -210,10 +210,10 @@ void processFKeyFunction(const key_code_t Key)
if (g_fkey_pressed)
{
#if 0
g_tx_vfo->am_mode = (g_tx_vfo->am_mode + 1) & 1u;
g_tx_vfo->channel.am_mode = (g_tx_vfo->am_mode + 1) & 1u;
#else
if (++g_tx_vfo->am_mode >= 3)
g_tx_vfo->am_mode = 0;
if (++g_tx_vfo->channel.am_mode >= 3)
g_tx_vfo->channel.am_mode = 0;
#endif
g_request_save_channel = 1;
}
@ -242,7 +242,7 @@ void processFKeyFunction(const key_code_t Key)
APP_stop_scan();
Band = g_tx_vfo->band + 1;
Band = g_tx_vfo->channel_attributes.band + 1;
if (g_eeprom.config.setting.enable_350 || Band != BAND5_350MHz)
{
if (Band > BAND7_470MHz)
@ -250,7 +250,7 @@ void processFKeyFunction(const key_code_t Key)
}
else
Band = BAND6_400MHz; // jump to next band
g_tx_vfo->band = Band;
g_tx_vfo->channel_attributes.band = Band;
g_eeprom.config.setting.indices.vfo[vfo].screen = FREQ_CHANNEL_FIRST + Band;
g_eeprom.config.setting.indices.vfo[vfo].frequency = FREQ_CHANNEL_FIRST + Band;
@ -397,7 +397,7 @@ void processFKeyFunction(const key_code_t Key)
return;
}
g_tx_vfo->frequency_reverse = g_tx_vfo->frequency_reverse == false;
g_tx_vfo->channel.frequency_reverse = g_tx_vfo->channel.frequency_reverse == false;
g_request_save_channel = 1;
break;
@ -566,9 +566,9 @@ void MAIN_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
g_another_voice_id = (voice_id_t)Key;
#endif
if (g_tx_vfo->band != band)
if (g_tx_vfo->channel_attributes.band != band)
{
g_tx_vfo->band = band;
g_tx_vfo->channel_attributes.band = band;
g_eeprom.config.setting.indices.vfo[vfo].screen = band + FREQ_CHANNEL_FIRST;
g_eeprom.config.setting.indices.vfo[vfo].frequency = band + FREQ_CHANNEL_FIRST;
@ -578,7 +578,7 @@ void MAIN_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
}
Frequency += g_tx_vfo->step_freq / 2; // for rounding to nearest step size
Frequency = FREQUENCY_floor_to_step(Frequency, g_tx_vfo->step_freq, FREQ_BAND_TABLE[g_tx_vfo->band].lower, FREQ_BAND_TABLE[g_tx_vfo->band].upper);
Frequency = FREQUENCY_floor_to_step(Frequency, g_tx_vfo->step_freq, FREQ_BAND_TABLE[g_tx_vfo->channel_attributes.band].lower, FREQ_BAND_TABLE[g_tx_vfo->channel_attributes.band].upper);
if (Frequency >= BX4819_BAND1.upper && Frequency < BX4819_BAND2.lower)
{ // clamp the frequency to the limit

View File

@ -43,6 +43,8 @@
#include "ui/inputbox.h"
#include "ui/menu.h"
#include "ui/menu.h"
#include "radio.h"
#include "settings.h"
#include "ui/ui.h"
#ifdef ENABLE_F_CAL_MENU
@ -411,19 +413,19 @@ void MENU_AcceptSetting(void)
break;
case MENU_CHAN_SQL:
g_tx_vfo->squelch_level = g_sub_menu_selection;
g_request_save_channel = 1;
g_vfo_configure_mode = VFO_CONFIGURE;
g_tx_vfo->channel.squelch_level = g_sub_menu_selection;
g_request_save_channel = 1;
g_vfo_configure_mode = VFO_CONFIGURE;
return;
case MENU_STEP:
g_tx_vfo->step_setting = step_freq_table_sorted[g_sub_menu_selection];
g_tx_vfo->channel.step_setting = step_freq_table_sorted[g_sub_menu_selection];
g_request_save_channel = 1;
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
return;
case MENU_TX_POWER:
g_tx_vfo->output_power = g_sub_menu_selection;
g_tx_vfo->channel.tx_power = g_sub_menu_selection;
g_request_save_channel = 1;
g_vfo_configure_mode = VFO_CONFIGURE_RELOAD;
return;
@ -492,22 +494,22 @@ void MENU_AcceptSetting(void)
return;
case MENU_SHIFT_DIR:
g_tx_vfo->tx_offset_freq_dir = g_sub_menu_selection;
g_request_save_channel = 1;
g_tx_vfo->channel.tx_offset_dir = g_sub_menu_selection;
g_request_save_channel = 1;
return;
case MENU_OFFSET:
g_tx_vfo->tx_offset_freq = g_sub_menu_selection;
g_request_save_channel = 1;
g_tx_vfo->channel.tx_offset = g_sub_menu_selection;
g_request_save_channel = 1;
return;
case MENU_BANDWIDTH:
g_tx_vfo->channel_bandwidth = g_sub_menu_selection;
g_request_save_channel = 1;
g_tx_vfo->channel.channel_bandwidth = g_sub_menu_selection;
g_request_save_channel = 1;
return;
case MENU_SCRAMBLER:
g_tx_vfo->scrambling_type = g_sub_menu_selection;
g_tx_vfo->channel.scrambler = g_sub_menu_selection;
#if 0
if (g_sub_menu_selection > 0 && g_eeprom.config.setting.enable_scrambler)
BK4819_EnableScramble(g_sub_menu_selection - 1);
@ -518,8 +520,8 @@ void MENU_AcceptSetting(void)
return;
case MENU_BUSY_CHAN_LOCK:
g_tx_vfo->busy_channel_lock = g_sub_menu_selection;
g_request_save_channel = 1;
g_tx_vfo->channel.busy_channel_lock = g_sub_menu_selection;
g_request_save_channel = 1;
return;
case MENU_MEM_SAVE:
@ -545,8 +547,8 @@ void MENU_AcceptSetting(void)
}
// save the channel name
memset(g_tx_vfo->name, 0, sizeof(g_tx_vfo->name));
memcpy(g_tx_vfo->name, g_edit, 10);
memset(g_tx_vfo->channel_name, 0, sizeof(g_tx_vfo->channel_name));
memcpy(g_tx_vfo->channel_name, g_edit, 10);
SETTINGS_save_channel(g_sub_menu_selection, g_eeprom.config.setting.tx_vfo_num, g_tx_vfo, 3);
g_flag_reconfigure_vfos = true;
return;
@ -634,14 +636,14 @@ void MENU_AcceptSetting(void)
#endif
case MENU_S_ADD1:
g_tx_vfo->scanlist_1_participation = g_sub_menu_selection;
g_tx_vfo->channel_attributes.scanlist1 = g_sub_menu_selection;
SETTINGS_save_chan_attribs_name(g_tx_vfo->channel_save, g_tx_vfo);
g_vfo_configure_mode = VFO_CONFIGURE;
g_flag_reset_vfos = true;
return;
case MENU_S_ADD2:
g_tx_vfo->scanlist_2_participation = g_sub_menu_selection;
g_tx_vfo->channel_attributes.scanlist2 = g_sub_menu_selection;
SETTINGS_save_chan_attribs_name(g_tx_vfo->channel_save, g_tx_vfo);
g_vfo_configure_mode = VFO_CONFIGURE;
g_flag_reset_vfos = true;
@ -675,7 +677,7 @@ void MENU_AcceptSetting(void)
#endif
case MENU_COMPAND:
g_tx_vfo->compand = g_sub_menu_selection;
g_tx_vfo->channel.compand = g_sub_menu_selection;
#if 1
g_request_save_channel = 1;
#else
@ -716,7 +718,7 @@ void MENU_AcceptSetting(void)
#ifdef ENABLE_MDC1200
case MENU_MDC1200_MODE:
g_tx_vfo->mdc1200_mode = g_sub_menu_selection;
g_tx_vfo->channel.mdc1200_mode = g_sub_menu_selection;
g_request_save_channel = 1;
break;
@ -726,10 +728,10 @@ void MENU_AcceptSetting(void)
#endif
case MENU_PTT_ID:
g_tx_vfo->dtmf_ptt_id_tx_mode = g_sub_menu_selection;
if (g_tx_vfo->dtmf_ptt_id_tx_mode == PTT_ID_TX_DOWN ||
g_tx_vfo->dtmf_ptt_id_tx_mode == PTT_ID_BOTH ||
g_tx_vfo->dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
g_tx_vfo->channel.dtmf_ptt_id_tx_mode = g_sub_menu_selection;
if (g_tx_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_TX_DOWN ||
g_tx_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_BOTH ||
g_tx_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
{
g_eeprom.config.setting.roger_mode = ROGER_MODE_OFF;
break;
@ -742,7 +744,7 @@ void MENU_AcceptSetting(void)
break;
case MENU_DTMF_DCD:
g_tx_vfo->dtmf_decoding_enable = g_sub_menu_selection;
g_tx_vfo->channel.dtmf_decoding_enable = g_sub_menu_selection;
DTMF_clear_RX();
g_request_save_channel = 1;
return;
@ -777,18 +779,18 @@ void MENU_AcceptSetting(void)
g_eeprom.config.setting.roger_mode = g_sub_menu_selection;
if (g_eeprom.config.setting.roger_mode != ROGER_MODE_OFF)
{
if (g_tx_vfo->dtmf_ptt_id_tx_mode == PTT_ID_TX_DOWN ||
g_tx_vfo->dtmf_ptt_id_tx_mode == PTT_ID_BOTH ||
g_tx_vfo->dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
if (g_tx_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_TX_DOWN ||
g_tx_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_BOTH ||
g_tx_vfo->channel.dtmf_ptt_id_tx_mode == PTT_ID_APOLLO)
{
g_tx_vfo->dtmf_ptt_id_tx_mode = PTT_ID_OFF; // // disable PTT ID tail
g_tx_vfo->channel.dtmf_ptt_id_tx_mode = PTT_ID_OFF; // // disable PTT ID tail
g_request_save_channel = 1;
}
}
break;
case MENU_MOD_MODE:
g_tx_vfo->am_mode = g_sub_menu_selection;
g_tx_vfo->channel.am_mode = g_sub_menu_selection;
g_request_save_channel = 1;
return;
/*
@ -965,15 +967,15 @@ void MENU_ShowCurrentSetting(void)
break;
case MENU_CHAN_SQL:
g_sub_menu_selection = g_tx_vfo->squelch_level;
g_sub_menu_selection = g_tx_vfo->channel.squelch_level;
break;
case MENU_STEP:
g_sub_menu_selection = FREQUENCY_get_step_index(STEP_FREQ_TABLE[g_tx_vfo->step_setting]);
g_sub_menu_selection = FREQUENCY_get_step_index(STEP_FREQ_TABLE[g_tx_vfo->channel.step_setting]);
break;
case MENU_TX_POWER:
g_sub_menu_selection = g_tx_vfo->output_power;
g_sub_menu_selection = g_tx_vfo->channel.tx_power;
break;
case MENU_RX_CDCSS:
@ -1019,23 +1021,23 @@ void MENU_ShowCurrentSetting(void)
break;
case MENU_SHIFT_DIR:
g_sub_menu_selection = g_tx_vfo->tx_offset_freq_dir;
g_sub_menu_selection = g_tx_vfo->channel.tx_offset_dir;
break;
case MENU_OFFSET:
g_sub_menu_selection = g_tx_vfo->tx_offset_freq;
g_sub_menu_selection = g_tx_vfo->channel.tx_offset;
break;
case MENU_BANDWIDTH:
g_sub_menu_selection = g_tx_vfo->channel_bandwidth;
g_sub_menu_selection = g_tx_vfo->channel.channel_bandwidth;
break;
case MENU_SCRAMBLER:
g_sub_menu_selection = g_tx_vfo->scrambling_type;
g_sub_menu_selection = g_tx_vfo->channel.scrambler;
break;
case MENU_BUSY_CHAN_LOCK:
g_sub_menu_selection = g_tx_vfo->busy_channel_lock;
g_sub_menu_selection = g_tx_vfo->channel.busy_channel_lock;
break;
case MENU_MEM_SAVE:
@ -1119,11 +1121,11 @@ void MENU_ShowCurrentSetting(void)
#endif
case MENU_S_ADD1:
g_sub_menu_selection = g_tx_vfo->scanlist_1_participation;
g_sub_menu_selection = g_tx_vfo->channel_attributes.scanlist1;
break;
case MENU_S_ADD2:
g_sub_menu_selection = g_tx_vfo->scanlist_2_participation;
g_sub_menu_selection = g_tx_vfo->channel_attributes.scanlist2;
break;
case MENU_STE:
@ -1151,7 +1153,7 @@ void MENU_ShowCurrentSetting(void)
#endif
case MENU_COMPAND:
g_sub_menu_selection = g_tx_vfo->compand;
g_sub_menu_selection = g_tx_vfo->channel.compand;
return;
case MENU_1_CALL:
@ -1218,7 +1220,7 @@ void MENU_ShowCurrentSetting(void)
#ifdef ENABLE_MDC1200
case MENU_MDC1200_MODE:
g_sub_menu_selection = g_tx_vfo->mdc1200_mode;
g_sub_menu_selection = g_tx_vfo->channel.mdc1200_mode;
break;
case MENU_MDC1200_ID:
@ -1227,7 +1229,7 @@ void MENU_ShowCurrentSetting(void)
#endif
case MENU_PTT_ID:
g_sub_menu_selection = g_tx_vfo->dtmf_ptt_id_tx_mode;
g_sub_menu_selection = g_tx_vfo->channel.dtmf_ptt_id_tx_mode;
break;
case MENU_BAT_TXT:
@ -1235,7 +1237,7 @@ void MENU_ShowCurrentSetting(void)
return;
case MENU_DTMF_DCD:
g_sub_menu_selection = g_tx_vfo->dtmf_decoding_enable;
g_sub_menu_selection = g_tx_vfo->channel.dtmf_decoding_enable;
break;
case MENU_DTMF_LIST:
@ -1255,7 +1257,7 @@ void MENU_ShowCurrentSetting(void)
break;
case MENU_MOD_MODE:
g_sub_menu_selection = g_tx_vfo->am_mode;
g_sub_menu_selection = g_tx_vfo->channel.am_mode;
break;
/*
#ifdef ENABLE_AM_FIX
@ -1782,7 +1784,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->am_mode == 0)
if (IS_NOT_NOAA_CHANNEL(g_rx_vfo->channel_save) && g_rx_vfo->channel.am_mode == 0)
{
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

View File

@ -251,7 +251,7 @@ static void SEARCH_Key_MENU(bool key_pressed, bool key_held)
}
g_tx_vfo->freq_config_tx = g_tx_vfo->freq_config_rx;
g_tx_vfo->step_setting = g_search_step_setting;
g_tx_vfo->channel.step_setting = g_search_step_setting;
}
else
{
@ -272,7 +272,7 @@ static void SEARCH_Key_MENU(bool key_pressed, bool key_held)
}
else
{
Channel = FREQ_CHANNEL_FIRST + g_tx_vfo->band;
Channel = FREQ_CHANNEL_FIRST + g_tx_vfo->channel_attributes.band;
g_eeprom.config.setting.indices.vfo[g_eeprom.config.setting.tx_vfo_num].frequency = Channel;
}
@ -605,13 +605,13 @@ void SEARCH_Start(void)
g_rx_vfo->channel_save = FREQ_CHANNEL_FIRST + BAND6_400MHz;
#endif
BackupStep = g_rx_vfo->step_setting;
BackupStep = g_rx_vfo->channel.step_setting;
BackupStepFreq = g_rx_vfo->step_freq;
RADIO_InitInfo(g_rx_vfo, g_rx_vfo->channel_save, g_rx_vfo->p_rx->frequency);
g_rx_vfo->step_setting = BackupStep;
g_rx_vfo->step_freq = BackupStepFreq;
g_rx_vfo->channel.step_setting = BackupStep;
g_rx_vfo->step_freq = BackupStepFreq;
g_monitor_enabled = false;
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
@ -626,7 +626,7 @@ void SEARCH_Start(void)
{
g_search_css_state = SEARCH_CSS_STATE_SCANNING;
g_search_frequency = g_rx_vfo->p_rx->frequency;
g_search_step_setting = g_rx_vfo->step_setting;
g_search_step_setting = g_rx_vfo->channel.step_setting;
BK4819_set_rf_filter_path(g_search_frequency);

View File

@ -36,6 +36,7 @@
#endif
#include "functions.h"
#include "misc.h"
#include "radio.h"
#include "settings.h"
#if defined(ENABLE_OVERLAY)
#include "sram-overlay.h"
@ -462,16 +463,16 @@ static void cmd_052F(const uint8_t *pBuffer)
{
const cmd_052F_t *pCmd = (const cmd_052F_t *)pBuffer;
g_rx_vfo = 0;
g_eeprom.config.setting.dual_watch = DUAL_WATCH_OFF;
g_eeprom.config.setting.cross_vfo = CROSS_BAND_OFF;
g_eeprom.config.setting.dtmf.side_tone = false;
g_vfo_info[0].frequency_reverse = false;
g_vfo_info[0].p_rx = &g_vfo_info[0].freq_config_rx;
g_vfo_info[0].p_tx = &g_vfo_info[0].freq_config_tx;
g_vfo_info[0].tx_offset_freq_dir = TX_OFFSET_FREQ_DIR_OFF;
g_vfo_info[0].dtmf_ptt_id_tx_mode = PTT_ID_OFF;
g_vfo_info[0].dtmf_decoding_enable = false;
g_rx_vfo_num = 0;
g_eeprom.config.setting.dual_watch = DUAL_WATCH_OFF;
g_eeprom.config.setting.cross_vfo = CROSS_BAND_OFF;
g_eeprom.config.setting.dtmf.side_tone = false;
g_vfo_info[0].channel.frequency_reverse = false;
g_vfo_info[0].p_rx = &g_vfo_info[0].freq_config_rx;
g_vfo_info[0].p_tx = &g_vfo_info[0].freq_config_tx;
g_vfo_info[0].channel.tx_offset_dir = TX_OFFSET_FREQ_DIR_OFF;
g_vfo_info[0].channel.dtmf_ptt_id_tx_mode = PTT_ID_OFF;
g_vfo_info[0].channel.dtmf_decoding_enable = false;
g_serial_config_tick_500ms = serial_config_tick_500ms;