0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 14:21:25 +03:00

Fix RADIO_ConfigureChannel() calls to make sense

This commit is contained in:
OneOfEleven 2023-09-28 22:42:52 +01:00
parent bf12719158
commit d2729c2007
8 changed files with 14 additions and 13 deletions

View File

@ -660,7 +660,7 @@ static void MR_NextChannel(void)
gEeprom.MrChannel[gEeprom.RX_CHANNEL] = gNextMrChannel;
gEeprom.ScreenChannel[gEeprom.RX_CHANNEL] = gNextMrChannel;
RADIO_ConfigureChannel(gEeprom.RX_CHANNEL, 2);
RADIO_ConfigureChannel(gEeprom.RX_CHANNEL, VFO_CONFIGURE_RELOAD);
RADIO_SetupRegisters(true);
gUpdateDisplay = true;
@ -1731,8 +1731,8 @@ void APP_TimeSlice500ms(void)
{
BK4819_StopScan();
RADIO_ConfigureChannel(0, 2);
RADIO_ConfigureChannel(1, 2);
RADIO_ConfigureChannel(0, VFO_CONFIGURE_RELOAD);
RADIO_ConfigureChannel(1, VFO_CONFIGURE_RELOAD);
RADIO_SetupRegisters(true);
}
@ -2009,7 +2009,7 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
SETTINGS_SaveChannel(gTxVfo->CHANNEL_SAVE, gEeprom.TX_CHANNEL, gTxVfo, gFlagSaveChannel);
gFlagSaveChannel = false;
RADIO_ConfigureChannel(gEeprom.TX_CHANNEL, 1);
RADIO_ConfigureChannel(gEeprom.TX_CHANNEL, VFO_CONFIGURE);
RADIO_SetupRegisters(true);
GUI_SelectNextDisplay(DISPLAY_MAIN);
}

View File

@ -370,7 +370,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
SETTINGS_SaveVfoIndices();
RADIO_ConfigureChannel(Vfo, 2);
RADIO_ConfigureChannel(Vfo, VFO_CONFIGURE_RELOAD);
}
// Frequency += 75; // is this meant to be rounding ?

View File

@ -236,8 +236,8 @@ static void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld)
}
else
{
RADIO_ConfigureChannel(0, 2);
RADIO_ConfigureChannel(1, 2);
RADIO_ConfigureChannel(0, VFO_CONFIGURE_RELOAD);
RADIO_ConfigureChannel(1, VFO_CONFIGURE_RELOAD);
gTxVfo->freq_config_RX.CodeType = gScanCssResultType;
gTxVfo->freq_config_RX.Code = gScanCssResultCode;
@ -427,7 +427,8 @@ void SCANNER_Stop(void)
{
gEeprom.MrChannel[gEeprom.RX_CHANNEL] = gRestoreMrChannel;
gEeprom.ScreenChannel[gEeprom.RX_CHANNEL] = Previous;
RADIO_ConfigureChannel(gEeprom.RX_CHANNEL, 2);
RADIO_ConfigureChannel(gEeprom.RX_CHANNEL, VFO_CONFIGURE_RELOAD);
}
else
{

Binary file not shown.

Binary file not shown.

4
main.c
View File

@ -85,8 +85,8 @@ void Main(void)
BOARD_EEPROM_LoadMoreSettings();
RADIO_ConfigureChannel(0, 2);
RADIO_ConfigureChannel(1, 2);
RADIO_ConfigureChannel(0, VFO_CONFIGURE_RELOAD);
RADIO_ConfigureChannel(1, VFO_CONFIGURE_RELOAD);
RADIO_SelectVfos();

View File

@ -143,7 +143,7 @@ void RADIO_InitInfo(VFO_Info_t *pInfo, uint8_t ChannelSave, uint8_t Band, uint32
RADIO_ConfigureSquelchAndOutputPower(pInfo);
}
void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure)
{
uint8_t Channel;
uint8_t Attributes;
@ -246,7 +246,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
else
Base = 0x0C80 + ((Channel - FREQ_CHANNEL_FIRST) * 32) + (VFO * 16);
if (Arg == VFO_CONFIGURE_RELOAD || Channel >= FREQ_CHANNEL_FIRST)
if (configure == VFO_CONFIGURE_RELOAD || Channel >= FREQ_CHANNEL_FIRST)
{
uint8_t Tmp;
uint8_t Data[8];

View File

@ -161,7 +161,7 @@ extern VfoState_t VfoState[2];
bool RADIO_CheckValidChannel(uint16_t ChNum, bool bCheckScanList, uint8_t RadioNum);
uint8_t RADIO_FindNextChannel(uint8_t ChNum, int8_t Direction, bool bCheckScanList, uint8_t RadioNum);
void RADIO_InitInfo(VFO_Info_t *pInfo, uint8_t ChannelSave, uint8_t ChIndex, uint32_t Frequency);
void RADIO_ConfigureChannel(uint8_t RadioNum, uint32_t Arg);
void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure);
void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo);
void RADIO_ApplyOffset(VFO_Info_t *pInfo);
void RADIO_SelectVfos(void);