diff --git a/README.md b/README.md index 5e9d5aa..758414b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Anyway, have fun. # Donations -Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC206, Frédéric F4ESO, Stéphane F5LGW and Jorge Ornelas for their [donations](https://www.paypal.com/paypalme/F4HWN). That’s so kind of them. Thanks so much 🙏🏻 +Special thanks to Jean-Cyrille F6IWW, Fabrice 14RC123, David F4BPP, Olivier 14RC206, Frédéric F4ESO, Stéphane F5LGW, Jorge Ornelas, Laurent F4AXK and Christophe Morel for their [donations](https://www.paypal.com/paypalme/F4HWN). That’s so kind of them. Thanks so much 🙏🏻 ## Table of Contents diff --git a/app/main.c b/app/main.c index d1ae573..b9856d7 100644 --- a/app/main.c +++ b/app/main.c @@ -65,7 +65,7 @@ static void toggle_chan_scanlist(void) gTxVfo->SCANLIST1_PARTICIPATION = !gTxVfo->SCANLIST1_PARTICIPATION; } - SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true); + SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true, true); gVfoConfigureMode = VFO_CONFIGURE; gFlagResetVfos = true; @@ -547,7 +547,7 @@ static void MAIN_Key_MENU(const bool bKeyPressed, const bool bKeyHeld) gTxVfo->SCANLIST1_PARTICIPATION = 0; gTxVfo->SCANLIST2_PARTICIPATION = 0; - SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true); + SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true, false); gVfoConfigureMode = VFO_CONFIGURE; gFlagResetVfos = true; diff --git a/app/menu.c b/app/menu.c index 4c45a18..b8d8724 100644 --- a/app/menu.c +++ b/app/menu.c @@ -616,14 +616,14 @@ void MENU_AcceptSetting(void) case MENU_S_ADD1: gTxVfo->SCANLIST1_PARTICIPATION = gSubMenuSelection; - SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true); + SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, false, true); gVfoConfigureMode = VFO_CONFIGURE; gFlagResetVfos = true; return; case MENU_S_ADD2: gTxVfo->SCANLIST2_PARTICIPATION = gSubMenuSelection; - SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true); + SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, false, true); gVfoConfigureMode = VFO_CONFIGURE; gFlagResetVfos = true; return; @@ -650,7 +650,7 @@ void MENU_AcceptSetting(void) case MENU_COMPAND: gTxVfo->Compander = gSubMenuSelection; - SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true); + SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, false, true); gVfoConfigureMode = VFO_CONFIGURE; gFlagResetVfos = true; // gRequestSaveChannel = 1; @@ -756,7 +756,7 @@ void MENU_AcceptSetting(void) #endif case MENU_DEL_CH: - SETTINGS_UpdateChannel(gSubMenuSelection, NULL, false, true); + SETTINGS_UpdateChannel(gSubMenuSelection, NULL, false, false, true); gVfoConfigureMode = VFO_CONFIGURE_RELOAD; gFlagResetVfos = true; return; diff --git a/settings.c b/settings.c index b0fa696..06dbdfe 100644 --- a/settings.c +++ b/settings.c @@ -714,7 +714,7 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO, #endif EEPROM_WriteBuffer(OffsetVFO + 8, State._8); - SETTINGS_UpdateChannel(Channel, pVFO, true, true); + SETTINGS_UpdateChannel(Channel, pVFO, true, true, true); if (IS_MR_CHANNEL(Channel)) { #ifndef ENABLE_KEEP_MEM_NAME @@ -749,7 +749,7 @@ void SETTINGS_SaveChannelName(uint8_t channel, const char * name) EEPROM_WriteBuffer(0x0F58 + offset, buf + 8); } -void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep, bool save) +void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep, bool check, bool save) { #ifdef ENABLE_NOAA if (!IS_NOAA_CHANNEL(channel)) @@ -771,7 +771,7 @@ void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep, att.scanlist1 = pVFO->SCANLIST1_PARTICIPATION; att.scanlist2 = pVFO->SCANLIST2_PARTICIPATION; att.compander = pVFO->Compander; - if (state[channel & 7u] == att.__val) + if (check && state[channel & 7u] == att.__val) return; // no change in the attributes } diff --git a/settings.h b/settings.h index 447c9eb..374c3c5 100644 --- a/settings.h +++ b/settings.h @@ -282,7 +282,7 @@ void SETTINGS_SaveSettings(void); void SETTINGS_SaveChannelName(uint8_t channel, const char * name); void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO, uint8_t Mode); void SETTINGS_SaveBatteryCalibration(const uint16_t * batteryCalibration); -void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep, bool save); +void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep, bool check, bool save); void SETTINGS_WriteBuildOptions(void); #endif