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

Some variable renames

This commit is contained in:
OneOfEleven
2023-09-25 18:08:21 +01:00
parent bcfe977b36
commit fa3dcf0015
18 changed files with 137 additions and 79 deletions

View File

@ -144,8 +144,8 @@ static void AIRCOPY_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gRxVfo->Band = i;
Frequency += 75;
Frequency = FREQUENCY_FloorToStep(Frequency, gRxVfo->StepFrequency, 0);
gRxVfo->ConfigRX.Frequency = Frequency;
gRxVfo->ConfigTX.Frequency = Frequency;
gRxVfo->freq_config_RX.Frequency = Frequency;
gRxVfo->freq_config_TX.Frequency = Frequency;
RADIO_ConfigureSquelchAndOutputPower(gRxVfo);
gCurrentVfo = gRxVfo;
RADIO_SetupRegisters(true);

View File

@ -563,7 +563,7 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix)
void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step)
{
uint32_t Frequency = pInfo->ConfigRX.Frequency + (Step * pInfo->StepFrequency);
uint32_t Frequency = pInfo->freq_config_RX.Frequency + (Step * pInfo->StepFrequency);
if (pInfo->StepFrequency == 833)
{
@ -584,7 +584,7 @@ void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step)
if (Frequency < LowerLimitFrequencyBandTable[pInfo->Band])
Frequency = FREQUENCY_FloorToStep(UpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, LowerLimitFrequencyBandTable[pInfo->Band]);
pInfo->ConfigRX.Frequency = Frequency;
pInfo->freq_config_RX.Frequency = Frequency;
}
static void FREQ_NextChannel(void)
@ -1912,7 +1912,7 @@ void CHANNEL_Next(bool bFlag, int8_t Direction)
else
{
if (bFlag)
gRestoreFrequency = gRxVfo->ConfigRX.Frequency;
gRestoreFrequency = gRxVfo->freq_config_RX.Frequency;
FREQ_NextChannel();
}

View File

@ -56,6 +56,43 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
// TODO: do something useful with the key
#ifdef ENABLE_COPY_CHAN_VFO
{ // copy channel to VFO
int channel = -1;
int vfo = -1;
if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE))
{ // VFO mode
if (IS_MR_CHANNEL(gRxVfo->CHANNEL_SAVE))
{ // other vfo is in channel mode
channel = gRxVfo->CHANNEL_SAVE;
vfo = gTxVfo->CHANNEL_SAVE;
}
}
else
if (IS_FREQ_CHANNEL((gRxVfo->CHANNEL_SAVE + 1) & 1))
{ // VFO mode
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE))
{ // other vfo is in channel mode
channel = gTxVfo->CHANNEL_SAVE;
vfo = gRxVfo->CHANNEL_SAVE;
}
}
if (channel >= 0 && vfo >= 0)
{ // copy the channel into the VFO
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
// gRequestSaveVFO = true;
// gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
// gRequestDisplayScreen = DISPLAY_MAIN;
}
}
#endif
#endif
break;
@ -71,7 +108,7 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
Band = gTxVfo->Band + 1;
if (gSetting_350EN || Band != BAND5_350MHz)
{
if (BAND7_470MHz < Band)
if (Band > BAND7_470MHz)
Band = BAND1_50MHz;
}
else
@ -80,6 +117,7 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
gEeprom.ScreenChannel[Vfo] = FREQ_CHANNEL_FIRST + Band;
gEeprom.FreqChannel[Vfo] = FREQ_CHANNEL_FIRST + Band;
gRequestSaveVFO = true;
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
gRequestDisplayScreen = DISPLAY_MAIN;
@ -361,7 +399,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
Frequency += 75;
gTxVfo->ConfigRX.Frequency = FREQUENCY_FloorToStep(Frequency, gTxVfo->StepFrequency, LowerLimitFrequencyBandTable[gTxVfo->Band]);
gTxVfo->freq_config_RX.Frequency = FREQUENCY_FloorToStep(Frequency, gTxVfo->StepFrequency, LowerLimitFrequencyBandTable[gTxVfo->Band]);
gRequestSaveChannel = 1;
return;

View File

@ -293,7 +293,7 @@ void MENU_AcceptSetting(void)
int32_t Min;
int32_t Max;
uint8_t Code;
FREQ_Config_t *pConfig = &gTxVfo->ConfigRX;
FREQ_Config_t *pConfig = &gTxVfo->freq_config_RX;
if (!MENU_GetLimits(gMenuCursor, &Min, &Max))
{
@ -328,7 +328,7 @@ void MENU_AcceptSetting(void)
return;
case MENU_T_DCS:
pConfig = &gTxVfo->ConfigTX;
pConfig = &gTxVfo->freq_config_TX;
// Fallthrough
@ -360,7 +360,7 @@ void MENU_AcceptSetting(void)
return;
case MENU_T_CTCS:
pConfig = &gTxVfo->ConfigTX;
pConfig = &gTxVfo->freq_config_TX;
// Fallthrough
@ -778,13 +778,13 @@ void MENU_ShowCurrentSetting(void)
break;
case MENU_R_DCS:
switch (gTxVfo->ConfigRX.CodeType)
switch (gTxVfo->freq_config_RX.CodeType)
{
case CODE_TYPE_DIGITAL:
gSubMenuSelection = gTxVfo->ConfigRX.Code + 1;
gSubMenuSelection = gTxVfo->freq_config_RX.Code + 1;
break;
case CODE_TYPE_REVERSE_DIGITAL:
gSubMenuSelection = gTxVfo->ConfigRX.Code + 105;
gSubMenuSelection = gTxVfo->freq_config_RX.Code + 105;
break;
default:
gSubMenuSelection = 0;
@ -797,17 +797,17 @@ void MENU_ShowCurrentSetting(void)
break;
case MENU_R_CTCS:
gSubMenuSelection = (gTxVfo->ConfigRX.CodeType == CODE_TYPE_CONTINUOUS_TONE) ? gTxVfo->ConfigRX.Code + 1 : 0;
gSubMenuSelection = (gTxVfo->freq_config_RX.CodeType == CODE_TYPE_CONTINUOUS_TONE) ? gTxVfo->freq_config_RX.Code + 1 : 0;
break;
case MENU_T_DCS:
switch (gTxVfo->ConfigTX.CodeType)
switch (gTxVfo->freq_config_TX.CodeType)
{
case CODE_TYPE_DIGITAL:
gSubMenuSelection = gTxVfo->ConfigTX.Code + 1;
gSubMenuSelection = gTxVfo->freq_config_TX.Code + 1;
break;
case CODE_TYPE_REVERSE_DIGITAL:
gSubMenuSelection = gTxVfo->ConfigTX.Code + 105;
gSubMenuSelection = gTxVfo->freq_config_TX.Code + 105;
break;
default:
gSubMenuSelection = 0;
@ -816,7 +816,7 @@ void MENU_ShowCurrentSetting(void)
break;
case MENU_T_CTCS:
gSubMenuSelection = (gTxVfo->ConfigTX.CodeType == CODE_TYPE_CONTINUOUS_TONE) ? gTxVfo->ConfigTX.Code + 1 : 0;
gSubMenuSelection = (gTxVfo->freq_config_TX.CodeType == CODE_TYPE_CONTINUOUS_TONE) ? gTxVfo->freq_config_TX.Code + 1 : 0;
break;
case MENU_SFT_D:

View File

@ -227,11 +227,11 @@ static void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld)
if (gScanUseCssResult)
{
gTxVfo->ConfigRX.CodeType = gScanCssResultType;
gTxVfo->ConfigRX.Code = gScanCssResultCode;
gTxVfo->freq_config_RX.CodeType = gScanCssResultType;
gTxVfo->freq_config_RX.Code = gScanCssResultCode;
}
gTxVfo->ConfigTX = gTxVfo->ConfigRX;
gTxVfo->freq_config_TX = gTxVfo->freq_config_RX;
gTxVfo->STEP_SETTING = gStepSetting;
}
else
@ -239,10 +239,10 @@ static void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld)
RADIO_ConfigureChannel(0, 2);
RADIO_ConfigureChannel(1, 2);
gTxVfo->ConfigRX.CodeType = gScanCssResultType;
gTxVfo->ConfigRX.Code = gScanCssResultCode;
gTxVfo->ConfigTX.CodeType = gScanCssResultType;
gTxVfo->ConfigTX.Code = gScanCssResultCode;
gTxVfo->freq_config_RX.CodeType = gScanCssResultType;
gTxVfo->freq_config_RX.Code = gScanCssResultCode;
gTxVfo->freq_config_TX.CodeType = gScanCssResultType;
gTxVfo->freq_config_TX.Code = gScanCssResultCode;
}
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE))
@ -431,7 +431,7 @@ void SCANNER_Stop(void)
}
else
{
gRxVfo->ConfigRX.Frequency = gRestoreFrequency;
gRxVfo->freq_config_RX.Frequency = gRestoreFrequency;
RADIO_ApplyOffset(gRxVfo);
RADIO_ConfigureSquelchAndOutputPower(gRxVfo);
}

View File

@ -376,8 +376,8 @@ static void CMD_052F(const uint8_t *pBuffer)
gEeprom.RX_CHANNEL = 0;
gEeprom.DTMF_SIDE_TONE = false;
gEeprom.VfoInfo[0].FrequencyReverse = false;
gEeprom.VfoInfo[0].pRX = &gEeprom.VfoInfo[0].ConfigRX;
gEeprom.VfoInfo[0].pTX = &gEeprom.VfoInfo[0].ConfigTX;
gEeprom.VfoInfo[0].pRX = &gEeprom.VfoInfo[0].freq_config_RX;
gEeprom.VfoInfo[0].pTX = &gEeprom.VfoInfo[0].freq_config_TX;
gEeprom.VfoInfo[0].TX_OFFSET_FREQUENCY_DIRECTION = TX_OFFSET_FREQUENCY_DIRECTION_OFF;
gEeprom.VfoInfo[0].DTMF_PTT_ID_TX_MODE = PTT_ID_OFF;
gEeprom.VfoInfo[0].DTMF_DECODING_ENABLE = false;