From 24f34eccbe3c11856dc686922f0d1e4782f4471b Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Mon, 10 Jul 2017 11:56:11 +1000 Subject: [PATCH] Add updater for CAN variables in this months firmware --- speeduino/updates.ino | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/speeduino/updates.ino b/speeduino/updates.ino index b8044392..0d085f14 100644 --- a/speeduino/updates.ino +++ b/speeduino/updates.ino @@ -8,7 +8,7 @@ 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 if(EEPROM.read(EEPROM_DATA_VERSION) == 2) @@ -23,6 +23,16 @@ void doUpdates() writeConfig(); 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) if( (EEPROM.read(EEPROM_DATA_VERSION) == 0) || (EEPROM.read(EEPROM_DATA_VERSION) == 255) )