Subversion Repositories FlightCtrl

Rev

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

Rev 1965 Rev 1967
Line 86... Line 86...
86
}
86
}
Line 87... Line 87...
87
 
87
 
88
/***************************************************/
88
/***************************************************/
89
/*       Read Parameter from EEPROM as word        */
89
/*       Read Parameter from EEPROM as word        */
-
 
90
/***************************************************/
90
/***************************************************/
91
/*
91
uint16_t getParamWord(uint16_t param_id) {
92
uint16_t getParamWord(uint16_t param_id) {
92
  return eeprom_read_word((uint16_t *) &EEPromArray[EEPROM_ADR_PARAM_BEGIN
93
  return eeprom_read_word((uint16_t *) &EEPromArray[EEPROM_ADR_PARAM_BEGIN
93
                                                    + param_id]);
94
                                                    + param_id]);
-
 
95
}
Line 94... Line 96...
94
}
96
*/
95
 
97
 
96
/***************************************************/
98
/***************************************************/
-
 
99
/*       Write Parameter to EEPROM as word         */
97
/*       Write Parameter to EEPROM as word         */
100
/***************************************************/
98
/***************************************************/
101
/*
99
void setParamWord(uint16_t param_id, uint16_t value) {
102
void setParamWord(uint16_t param_id, uint16_t value) {
-
 
103
  eeprom_write_word((uint16_t *) &EEPromArray[EEPROM_ADR_PARAM_BEGIN + param_id], value);
Line 100... Line 104...
100
  eeprom_write_word((uint16_t *) &EEPromArray[EEPROM_ADR_PARAM_BEGIN + param_id], value);
104
}
101
}
105
*/
102
 
106
 
103
uint8_t calculateChecksum(uint8_t* data, uint16_t length) {
107
uint8_t calculateChecksum(uint8_t* data, uint16_t length) {
Line 221... Line 225...
221
}
225
}
Line 222... Line 226...
222
 
226
 
223
/***************************************************/
227
/***************************************************/
224
/* Sensor offsets                                  */
228
/* Sensor offsets                                  */
-
 
229
/***************************************************/
-
 
230
uint8_t gyroAmplifierOffset_readFromEEProm(void) {
-
 
231
  return readChecksummedBlock(SENSOROFFSET_REVISION, (uint8_t*)&gyroAmplifierOffset, EEPROM_ADR_GYROAMPLIFIER, sizeof(sensorOffset_t));
-
 
232
}
-
 
233
 
-
 
234
void gyroAmplifierOffset_writeToEEProm(void) {
-
 
235
  return writeChecksummedBlock(SENSOROFFSET_REVISION, (uint8_t*)&gyroAmplifierOffset, EEPROM_ADR_GYROAMPLIFIER, sizeof(sensorOffset_t));
-
 
236
}
225
/***************************************************/
237
 
226
uint8_t gyroOffset_readFromEEProm(void) {
238
uint8_t gyroOffset_readFromEEProm(void) {
227
  return readChecksummedBlock(SENSOROFFSET_REVISION, (uint8_t*)&gyroOffset, EEPROM_ADR_GYROOFFSET, sizeof(sensorOffset_t)) |
-
 
228
  readChecksummedBlock(SENSOROFFSET_REVISION, (uint8_t*)&DACValues, EEPROM_ADR_DACVALUES, sizeof(sensorOffset_t));
239
  return readChecksummedBlock(SENSOROFFSET_REVISION, (uint8_t*)&gyroOffset, EEPROM_ADR_GYROOFFSET, sizeof(sensorOffset_t));
Line 229... Line 240...
229
}
240
}
230
 
241
 
231
void gyroOffset_writeToEEProm(void) {
-
 
232
  writeChecksummedBlock(SENSOROFFSET_REVISION, (uint8_t*)&gyroOffset, EEPROM_ADR_GYROOFFSET, sizeof(sensorOffset_t));
242
void gyroOffset_writeToEEProm(void) {
Line 233... Line 243...
233
  writeChecksummedBlock(SENSOROFFSET_REVISION, (uint8_t*)&DACValues, EEPROM_ADR_DACVALUES, sizeof(sensorOffset_t));
243
  writeChecksummedBlock(SENSOROFFSET_REVISION, (uint8_t*)&gyroOffset, EEPROM_ADR_GYROOFFSET, sizeof(sensorOffset_t));
234
}
244
}
235
 
245