diff --git a/storage.h b/storage.h index 23ecb1e7..0ec4fad6 100644 --- a/storage.h +++ b/storage.h @@ -72,6 +72,7 @@ Current layout of EEPROM data (Version 3) is as follows (All sizes are in bytes) #define EEPROM_CONFIG8_MAP2 1211 #define EEPROM_CONFIG8_XBINS2 1275 #define EEPROM_CONFIG8_YBINS2 1283 +#define EEPROM_CONFIG8_END 1291 //Calibration data is stored at the end of the EEPROM (This is in case any further calibration tables are needed as they are large blocks) #define EEPROM_CALIBRATION_O2 2559 diff --git a/storage.ino b/storage.ino index a05bd6be..0da894ac 100644 --- a/storage.ino +++ b/storage.ino @@ -156,6 +156,46 @@ void writeConfig() { if(EEPROM.read(x) != *(pnt_configPage + byte(x - EEPROM_CONFIG7_START))) { EEPROM.write(x, *(pnt_configPage + byte(x - EEPROM_CONFIG7_START))); } } + + /*--------------------------------------------------- + | Boost and vvt tables (See storage.h for data layout) - Page 8 + | 8x8 table itself + the 8 values along each of the axis + -----------------------------------------------------*/ + //Begin writing the 2 tables, basically the same thing as above but we're doing these 2 together (2 tables per page instead of 1) + if(EEPROM.read(EEPROM_CONFIG8_XSIZE1) != boostTable.xSize) { EEPROM.write(EEPROM_CONFIG8_XSIZE1,boostTable.xSize); } //Write the boost Table RPM dimension size + if(EEPROM.read(EEPROM_CONFIG8_YSIZE1) != boostTable.ySize) { EEPROM.write(EEPROM_CONFIG8_YSIZE1,boostTable.ySize); } //Write the boost Table MAP/TPS dimension size + if(EEPROM.read(EEPROM_CONFIG8_XSIZE2) != vvtTable.xSize) { EEPROM.write(EEPROM_CONFIG8_XSIZE2,vvtTable.xSize); } //Write the vvt Table RPM dimension size + if(EEPROM.read(EEPROM_CONFIG8_YSIZE2) != vvtTable.ySize) { EEPROM.write(EEPROM_CONFIG8_YSIZE2,vvtTable.ySize); } //Write the vvt Table MAP/TPS dimension size + + int y = EEPROM_CONFIG8_MAP2; //We do the 2 maps together in the same loop + for(int x=EEPROM_CONFIG8_MAP1; x