Add updater for CAN variables in this months firmware

This commit is contained in:
Josh Stewart 2017-07-10 11:56:11 +10:00
parent 7e5fb7bb5c
commit 24f34eccbe
1 changed files with 11 additions and 1 deletions

View File

@ -8,7 +8,7 @@
void doUpdates() void doUpdates()
{ {
#define CURRENT_DATA_VERSION 3 #define CURRENT_DATA_VERSION 4
//May 2017 firmware introduced a -40 offset on the ignition table. Update that table to +40 //May 2017 firmware introduced a -40 offset on the ignition table. Update that table to +40
if(EEPROM.read(EEPROM_DATA_VERSION) == 2) if(EEPROM.read(EEPROM_DATA_VERSION) == 2)
@ -23,6 +23,16 @@ void doUpdates()
writeConfig(); writeConfig();
EEPROM.write(EEPROM_DATA_VERSION, 3); EEPROM.write(EEPROM_DATA_VERSION, 3);
} }
//June 2017 required the forced addition of some CAN values to avoid weird errors
if(EEPROM.read(EEPROM_DATA_VERSION) == 3)
{
configPage10.speeduino_tsCanId = 0;
configPage10.true_address = 256;
configPage10.realtime_base_address = 336;
writeConfig();
EEPROM.write(EEPROM_DATA_VERSION, 4);
}
//Final check is always for 255 and 0 (Brand new arduino) //Final check is always for 255 and 0 (Brand new arduino)
if( (EEPROM.read(EEPROM_DATA_VERSION) == 0) || (EEPROM.read(EEPROM_DATA_VERSION) == 255) ) if( (EEPROM.read(EEPROM_DATA_VERSION) == 0) || (EEPROM.read(EEPROM_DATA_VERSION) == 255) )