Write to EEPROM more aggressively when engine not running

This commit is contained in:
Josh Stewart 2022-02-24 10:50:01 +11:00
parent 738ae2ed93
commit b7901568a0
2 changed files with 7 additions and 3 deletions

View File

@ -84,7 +84,11 @@ struct write_location {
bool can_write() const
{
return (counter<=EEPROM_MAX_WRITE_BLOCK);
bool canWrite = false;
if(currentStatus.RPM > 0) { canWrite = (counter <= EEPROM_MAX_WRITE_BLOCK); }
else { canWrite = (counter <= (EEPROM_MAX_WRITE_BLOCK * 8)); } //Write to EEPROM more aggresively if the engine is not running
return canWrite;
}
};

View File

@ -183,6 +183,6 @@ extern uint32_t deferEEPROMWritesUntil;
#define EEPROM_CALIBRATION_IAT_OLD 3071
#define EEPROM_CALIBRATION_CLT_OLD 3583
#define EEPROM_DEFER_DELAY 1500000UL //1.5 second pause after large comms before writing to EEPROM
#define EEPROM_DEFER_DELAY 1000000UL //1.5 second pause after large comms before writing to EEPROM
#endif // STORAGE_H