EEPROM: Don't erase if we don't have to. Adding eeprom_driver_format abstraction. (#18332)

This commit is contained in:
Purdea Andrei
2024-05-28 14:49:55 +03:00
committed by GitHub
parent 6921c8a7dd
commit 267dffda15
10 changed files with 63 additions and 4 deletions

View File

@@ -46,7 +46,7 @@ __attribute__((weak)) void eeconfig_init_kb(void) {
*/
void eeconfig_init_quantum(void) {
#if defined(EEPROM_DRIVER)
eeprom_driver_erase();
eeprom_driver_format(false);
#endif
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
@@ -108,7 +108,7 @@ void eeconfig_enable(void) {
*/
void eeconfig_disable(void) {
#if defined(EEPROM_DRIVER)
eeprom_driver_erase();
eeprom_driver_format(false);
#endif
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER_OFF);
}