mirror of
https://github.com/DualTachyon/uv-k5-firmware.git
synced 2025-01-18 17:03:58 +08:00
Added BOARD_FactoryReset.
This commit is contained in:
parent
33f9f21c4f
commit
be06dc365d
@ -471,7 +471,7 @@ void MENU_AcceptSetting(void)
|
||||
return;
|
||||
|
||||
case MENU_RESET:
|
||||
//EepromFactoryReset(gSubMenuSelection);
|
||||
BOARD_FactoryReset(gSubMenuSelection);
|
||||
return;
|
||||
|
||||
case MENU_350TX:
|
||||
|
25
board.c
25
board.c
@ -825,3 +825,28 @@ void BOARD_EEPROM_LoadMoreSettings(void)
|
||||
BK4819_WriteRegister(BK4819_REG_3B, gEeprom.BK4819_XTAL_FREQ_LOW + 22656);
|
||||
}
|
||||
|
||||
void BOARD_FactoryReset(bool bIsAll)
|
||||
{
|
||||
uint8_t Template[8];
|
||||
uint16_t i;
|
||||
|
||||
memset(Template, 0xFF, sizeof(Template));
|
||||
for (i = 0x0C80; i < 0x1E00; i += 8) {
|
||||
if (
|
||||
!(i >= 0x0EE0 && i < 0x0F18) && // ANI ID + DTMF codes
|
||||
!(i >= 0x0F30 && i < 0x0F50) && // AES KEY + F LOCK + Scramble Enable
|
||||
!(i >= 0x1C00 && i < 0x1E00) && // DTMF contacts
|
||||
!(i >= 0x0EB0 && i < 0x0ED0) && // Welcome strings
|
||||
!(i >= 0x0EA0 && i < 0x0EA8) && // Voice Prompt
|
||||
(bIsAll || (
|
||||
!(i >= 0x0D60 && i < 0x0E28) && // MR Channel Attributes
|
||||
!(i >= 0x0F18 && i < 0x0F30) && // Scan List
|
||||
!(i >= 0x0F50 && i < 0x1C00) && // MR Channel NAmes
|
||||
!(i >= 0x0E40 && i < 0x0E70) && // FM Channels
|
||||
!(i >= 0x0E88 && i < 0x0E90))) // FM settings
|
||||
) {
|
||||
EEPROM_WriteBuffer(i, Template);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user