Skip to content

Commit

Permalink
Update clear_eeprom.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-8 committed Sep 22, 2024
1 parent 1a7b491 commit cfb4dc1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions clear_eeprom/clear_eeprom.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
#if defined(ARDUINO_ARCH_MBED_RP2040)|| defined(ARDUINO_ARCH_RP2040)
#if defined(ARDUINO_ARCH_MBED_RP2040) || defined(ARDUINO_ARCH_RP2040) || defined(ESP32)
EEPROM.begin(1024);

#endif
for (int i = 0 ; i < EEPROM.length() ; i++) {
EEPROM.write(i, 255);
delay(1);
}
#if defined(ARDUINO_ARCH_MBED_RP2040)|| defined(ARDUINO_ARCH_RP2040)
EEPROM.commit(); // rp2040 EEPROM library requires this to be used to write the updated data to the flash that is simulating EEPROM (flash has more limited cycles)
#if defined(ARDUINO_ARCH_MBED_RP2040)|| defined(ARDUINO_ARCH_RP2040) || defined(ESP32)
EEPROM.commit(); // rp2040 and esp32 EEPROM libraries require this to be used to write the updated data to the flash that is simulating EEPROM (flash has more limited cycles)
#endif
digitalWrite(LED_BUILTIN, LOW);
}
Expand Down

0 comments on commit cfb4dc1

Please sign in to comment.