We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55f9ea1 commit c2bc1ccCopy full SHA for c2bc1cc
Firmware/LoRaSerial/NVM.ino
@@ -198,3 +198,29 @@ void nvmSaveVcUniqueId(int8_t vc)
198
if (memcmp(id, virtualCircuitList[vc].uniqueId, sizeof(id)) != 0)
199
nvmSaveUniqueId(vc, virtualCircuitList[vc].uniqueId);
200
}
201
+
202
+//Erase the entire EEPROM
203
+void nvmErase()
204
+{
205
+ int address;
206
+ int length;
207
+ uint8_t value[64];
208
209
+ //Get the EEPROM length
210
+ length = EEPROM.length();
211
212
+ //Set the erase value
213
+ memset(&value, NVM_ERASE_VALUE, sizeof(value));
214
215
+ //Erase the EEPROM
216
+ address = 0;
217
+ while (address < length)
218
+ {
219
+ petWDT();
220
+ EEPROM.put(address, value);
221
+ address += sizeof(value);
222
+ }
223
224
+ //Finish the write
225
+ arch.eepromCommit();
226
+}
0 commit comments