Subversion Repositories FlightCtrl

Rev

Rev 1969 | Rev 2055 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1969 Rev 2039
Line 137... Line 137...
137
/***************************************************/
137
/***************************************************/
138
/*       Read Parameter Set from EEPROM            */
138
/*       Read Parameter Set from EEPROM            */
139
/***************************************************/
139
/***************************************************/
140
// setnumber [1..5]
140
// setnumber [1..5]
141
uint8_t paramSet_readFromEEProm(uint8_t setnumber) {
141
uint8_t paramSet_readFromEEProm(uint8_t setnumber) {
142
  uint16_t offset = EEPROM_ADR_PARAMSET_BEGIN + (setnumber-1)*(sizeof(paramset_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD);
142
  uint16_t offset = EEPROM_ADR_PARAMSET_BEGIN + (setnumber-1)*(sizeof(ParamSet_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD);
143
  output_init(); // what's that doing here??
143
  // output_init(); // what's that doing here??
144
  return readChecksummedBlock(EEPARAM_REVISION, (uint8_t*)&staticParams, offset, sizeof(paramset_t));
144
  return readChecksummedBlock(EEPARAM_REVISION, (uint8_t*)&staticParams, offset, sizeof(ParamSet_t));
145
}
145
}
Line 146... Line 146...
146
 
146
 
147
/***************************************************/
147
/***************************************************/
148
/*        Write Parameter Set to EEPROM            */
148
/*        Write Parameter Set to EEPROM            */
149
/***************************************************/
149
/***************************************************/
150
void paramSet_writeToEEProm(uint8_t setnumber) {
150
void paramSet_writeToEEProm(uint8_t setnumber) {
151
  uint16_t offset = EEPROM_ADR_PARAMSET_BEGIN + (setnumber-1)*(sizeof(paramset_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD);
151
  uint16_t offset = EEPROM_ADR_PARAMSET_BEGIN + (setnumber-1)*(sizeof(ParamSet_t)+EEPROM_CHECKSUMMED_BLOCK_OVERHEAD);
152
  writeChecksummedBlock(EEPARAM_REVISION, (uint8_t*)&staticParams, offset, sizeof(paramset_t));
152
  writeChecksummedBlock(EEPARAM_REVISION, (uint8_t*)&staticParams, offset, sizeof(ParamSet_t));
153
  // set this parameter set to active set
153
  // set this parameter set to active set
154
  setActiveParamSet(setnumber);
154
  setActiveParamSet(setnumber);
155
  output_init(); // what's that doing here??
155
  // output_init(); // what's that doing here??
Line 156... Line 156...
156
}
156
}
157
 
157
 
158
void paramSet_readOrDefault() {
158
void paramSet_readOrDefault() {