2017-05-15 22:05:39 -07:00
|
|
|
/*
|
|
|
|
* This routine is used for doing any data conversions that are required during firmware changes
|
|
|
|
* This prevents users getting difference reports in TS when such a data change occurs.
|
|
|
|
* It also can be used for setting good values when there are viarables that move locations in the ini
|
|
|
|
* When a user skips multiple firmware versions at a time, this will roll through the updates 1 at a time
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
void doUpdates()
|
|
|
|
{
|
|
|
|
#define CURRENT_DATA_VERSION 3
|
|
|
|
|
2017-08-02 18:46:48 -07:00
|
|
|
//May 2017 firmware introduced a -40 offset on the ignition table. Update that table to +40
|
|
|
|
if(EEPROM.read(EEPROM_DATA_VERSION) == 2)
|
|
|
|
{
|
|
|
|
for(int x=0; x<16; x++)
|
2017-05-15 22:05:39 -07:00
|
|
|
{
|
2017-08-02 18:46:48 -07:00
|
|
|
for(int y=0; y<16; y++)
|
2017-05-15 22:05:39 -07:00
|
|
|
{
|
2017-08-02 18:46:48 -07:00
|
|
|
ignitionTable.values[x][y] = ignitionTable.values[x][y] + 40;
|
2017-05-15 22:05:39 -07:00
|
|
|
}
|
|
|
|
}
|
2017-08-02 18:46:48 -07:00
|
|
|
writeConfig();
|
|
|
|
EEPROM.write(EEPROM_DATA_VERSION, 3);
|
|
|
|
}
|
2017-05-15 22:05:39 -07:00
|
|
|
|
2017-08-02 18:46:48 -07:00
|
|
|
//Final check is always for 255 and 0 (Brand new arduino)
|
|
|
|
if( (EEPROM.read(EEPROM_DATA_VERSION) == 0) || (EEPROM.read(EEPROM_DATA_VERSION) == 255) )
|
|
|
|
{
|
|
|
|
configPage10.true_address = 0x200;
|
|
|
|
EEPROM.write(EEPROM_DATA_VERSION, CURRENT_DATA_VERSION);
|
2017-06-02 14:09:36 -07:00
|
|
|
|
2017-08-02 18:46:48 -07:00
|
|
|
}
|
|
|
|
}
|