Set EEPROM write limit to 10k

This commit is contained in:
Felix Rusu 2018-11-28 13:12:01 -05:00
parent 3f10fd6abc
commit e543fb1fb5
2 changed files with 2 additions and 0 deletions

View File

@ -153,6 +153,7 @@ void setup(void)
#ifdef SERIAL_EN #ifdef SERIAL_EN
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
#endif #endif
EEPROM.setMaxAllowedWrites(10000);
EEPROM.readBlock(0, CONFIG); EEPROM.readBlock(0, CONFIG);
if (CONFIG.frequency!=RF69_433MHZ && CONFIG.frequency!=RF69_868MHZ && CONFIG.frequency!=RF69_915MHZ) // virgin CONFIG, expected [4,8,9] if (CONFIG.frequency!=RF69_433MHZ && CONFIG.frequency!=RF69_868MHZ && CONFIG.frequency!=RF69_915MHZ) // virgin CONFIG, expected [4,8,9]
{ {

View File

@ -170,6 +170,7 @@ void setup(void)
#ifdef SERIAL_EN #ifdef SERIAL_EN
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
#endif #endif
EEPROM.setMaxAllowedWrites(10000);
EEPROM.readBlock(0, CONFIG); EEPROM.readBlock(0, CONFIG);
if (CONFIG.frequency!=RF69_433MHZ && CONFIG.frequency!=RF69_868MHZ && CONFIG.frequency!=RF69_915MHZ) // virgin CONFIG, expected [4,8,9] if (CONFIG.frequency!=RF69_433MHZ && CONFIG.frequency!=RF69_868MHZ && CONFIG.frequency!=RF69_915MHZ) // virgin CONFIG, expected [4,8,9]
{ {