#include /* Takes the current configuration (config pages and maps) and writes them to EEPROM as per the layout defined in storage.h */ void writeConfig() { /* We only ever write to the EEPROM where the new value is different from the currently stored byte This is due to the limited write life of the EEPROM (Approximately 100,000 writes) */ int offset; //Create a pointer to the config page byte* pnt_configPage; pnt_configPage = (byte *)&configPage1; //Create a pointer to Page 1 in memory if(EEPROM.read(0) != data_structure_version) { EEPROM.write(0,data_structure_version); } //Write the data structure version //Fuel table (See storage.h for data layout) if(EEPROM.read(EEPROM_CONFIG1_XSIZE) != fuelTable.xSize) { EEPROM.write(EEPROM_CONFIG1_XSIZE, fuelTable.xSize); } //Write the VE Tables RPM dimension size if(EEPROM.read(EEPROM_CONFIG1_YSIZE) != fuelTable.ySize) { EEPROM.write(EEPROM_CONFIG1_YSIZE, fuelTable.ySize); } //Write the VE Tables MAP/TPS dimension size for(int x=EEPROM_CONFIG1_MAP; x