Actuall save config params to eeprom after modification!

This commit is contained in:
Raphael Assenat 2015-10-15 23:42:30 -04:00
parent e988591eaf
commit 5818aa2175
1 changed files with 11 additions and 7 deletions

View File

@ -69,31 +69,35 @@ unsigned char config_setParam(unsigned char param, const unsigned char *value)
{ {
case CFG_PARAM_MODE: case CFG_PARAM_MODE:
g_eeprom_data.cfg.mode = value[0]; g_eeprom_data.cfg.mode = value[0];
return 1; break;
case CFG_PARAM_SERIAL: case CFG_PARAM_SERIAL:
config_set_serial((char*)value); config_set_serial((char*)value);
return 1; break;
case CFG_PARAM_POLL_INTERVAL0: case CFG_PARAM_POLL_INTERVAL0:
g_eeprom_data.cfg.poll_interval[0] = value[0]; g_eeprom_data.cfg.poll_interval[0] = value[0];
return 1; break;
#if NUM_CHANNELS > 1 #if NUM_CHANNELS > 1
case CFG_PARAM_POLL_INTERVAL1: case CFG_PARAM_POLL_INTERVAL1:
g_eeprom_data.cfg.poll_interval[1] = value[0]; g_eeprom_data.cfg.poll_interval[1] = value[0];
return 1; break;
#endif #endif
#if NUM_CHANNELS > 2 #if NUM_CHANNELS > 2
case CFG_PARAM_POLL_INTERVAL2: case CFG_PARAM_POLL_INTERVAL2:
g_eeprom_data.cfg.poll_interval[2] = value[0]; g_eeprom_data.cfg.poll_interval[2] = value[0];
return 1; break;
#endif #endif
#if NUM_CHANNELS > 3 #if NUM_CHANNELS > 3
case CFG_PARAM_POLL_INTERVAL3: case CFG_PARAM_POLL_INTERVAL3:
g_eeprom_data.cfg.poll_interval[3] = value[0]; g_eeprom_data.cfg.poll_interval[3] = value[0];
return 1; break;
#endif #endif
default:
return 0;
} }
return 0; eeprom_commit();
return 1;
} }