From 011009b294fbd7aa8b44cee490e9d308f669e381 Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Tue, 27 Jan 2026 19:01:44 +0100 Subject: [PATCH] Improve SETTINGS_FactoryReset --- App/settings.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/App/settings.c b/App/settings.c index f32f8787..86afbdf5 100644 --- a/App/settings.c +++ b/App/settings.c @@ -558,6 +558,13 @@ void SETTINGS_FactoryReset(bool bIsAll) Data8[4] &= (uint8_t)~0x01; Data8[4] &= (uint8_t)~0x02; + + // SET_KEY to 0 + Data8[4] &= (uint8_t)~0x3C; // Clear bits 2-5 (SET_KEY) + + // SET_NAV to false + Data8[4] &= (uint8_t)~0x40; // Clear bit 6 (SET_NAV) for UV-K1 by default + #ifdef ENABLE_FEAT_F4HWN_RESET_VFO Data8[7] = (1 & 0x01); #endif @@ -580,9 +587,12 @@ void SETTINGS_FactoryReset(bool bIsAll) gEeprom.FreqChannel[0] = FREQ_CHANNEL_FIRST + BAND3_137MHz; gEeprom.FreqChannel[1] = FREQ_CHANNEL_FIRST + BAND6_400MHz; - SETTINGS_SaveVfoIndices(); SETTINGS_SaveChannel(FREQ_CHANNEL_FIRST + BAND3_137MHz, 0, &gEeprom.VfoInfo[0], 2); SETTINGS_SaveChannel(FREQ_CHANNEL_FIRST + BAND6_400MHz, 1, &gEeprom.VfoInfo[1], 2); + + gVfoStateChanged = true; + gScheduleVfoSave = true; + SETTINGS_SaveVfoIndicesFlush(); #endif }