From d2729c2007a31941197ca2106191608e6e277dbe Mon Sep 17 00:00:00 2001 From: OneOfEleven Date: Thu, 28 Sep 2023 22:42:52 +0100 Subject: [PATCH] Fix RADIO_ConfigureChannel() calls to make sense --- app/app.c | 8 ++++---- app/main.c | 2 +- app/scanner.c | 7 ++++--- firmware.bin | Bin 57816 -> 57816 bytes firmware.packed.bin | Bin 57834 -> 57834 bytes main.c | 4 ++-- radio.c | 4 ++-- radio.h | 2 +- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/app.c b/app/app.c index 9659bd3..0269301 100644 --- a/app/app.c +++ b/app/app.c @@ -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); } diff --git a/app/main.c b/app/main.c index ae182c7..11ab6e3 100644 --- a/app/main.c +++ b/app/main.c @@ -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 ? diff --git a/app/scanner.c b/app/scanner.c index bd27698..cc52d65 100644 --- a/app/scanner.c +++ b/app/scanner.c @@ -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 { diff --git a/firmware.bin b/firmware.bin index cf8dd2c358206de512e59f62a1e4c264a54a7ab5..1106721840dce09a84fb932e5fd59f9e603bf524 100644 GIT binary patch delta 47 ycmca{nEA$G<_+`uSriyvZ`!=5zs^T2Db3Kx+|ZJji^1R3EnFAM-E4Me5i0=8oDmoR delta 47 ycmca{nEA$G<_+`uS+p4x7&b5Juk#TzGqgxCvoz!7V(@o$3)h8mH=EsA#0mhDP!C=J diff --git a/firmware.packed.bin b/firmware.packed.bin index 4f0834a15ab85ac989931b96368ff57e3b8716a9..9be5749faf4c5c0c1917da91534a4432804f06d3 100644 GIT binary patch delta 63 zcmV-F0Kot1!vpHW1F!}l2P*P_QdjC$vkf4jZv= FREQ_CHANNEL_FIRST) + if (configure == VFO_CONFIGURE_RELOAD || Channel >= FREQ_CHANNEL_FIRST) { uint8_t Tmp; uint8_t Data[8]; diff --git a/radio.h b/radio.h index 99246fa..70b39a6 100644 --- a/radio.h +++ b/radio.h @@ -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);