void LoadParamsFromEEPROM(void) { printf("load params from eeprom failed,set default value\r\n"); ParamSetDefault();//版本检测不对,各项参数设为默认值 ParamToTable(); table.version=EEPROM_DEFAULT_VERSION; TableWriteEEPROM(); }
void LoadParamsFromEEPROM(void) { if(isEEPROMValid()) { TableReadEEPROM(); TableToParam(); } else { ParamSetDefault();//版本检测不对,各项参数设为默认值 ParamToTable(); table.version=EEPROM_DEFAULT_VERSION; TableWriteEEPROM(); } }
void SaveParamsToEEPROM(void) { ParamToTable(); TableWriteEEPROM(); }