EEPROM: Don't erase if we don't have to. Adding eeprom_driver_format abstraction. (#18332)
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "timer.h"
|
||||
#include "spi_master.h"
|
||||
#include "eeprom.h"
|
||||
#include "eeprom_driver.h"
|
||||
#include "eeprom_spi.h"
|
||||
|
||||
#define CMD_WREN 6
|
||||
@@ -92,6 +93,13 @@ void eeprom_driver_init(void) {
|
||||
spi_init();
|
||||
}
|
||||
|
||||
void eeprom_driver_format(bool erase) {
|
||||
/* spi eeproms do not need to be formatted before use */
|
||||
if (erase) {
|
||||
eeprom_driver_erase();
|
||||
}
|
||||
}
|
||||
|
||||
void eeprom_driver_erase(void) {
|
||||
#if defined(CONSOLE_ENABLE) && defined(DEBUG_EEPROM_OUTPUT)
|
||||
uint32_t start = timer_read32();
|
||||
|
||||
Reference in New Issue
Block a user