Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2105 → Rev 2106

/branches/dongfang_FC_fixedwing/analog.c
51,7 → 51,7
* to be centered on zero.
*/
sensorOffset_t gyroOffset;
int16_t airpressureOffset;
uint16_t airpressureOffset;
 
/*
* In the MK coordinate system, nose-down is positive and left-roll is positive.
119,7 → 119,7
* So the initial value of 100 is for 9.7 volts.
*/
uint16_t UBat = 100;
uint16_t airspeed = 0;
uint16_t airspeedVelocity = 0;
 
/*
* Control and status.
371,7 → 371,7
void analog_update(void) {
analog_updateGyros();
// analog_updateAccelerometers();
analog_updateAirPressure();
analog_updateAirspeed();
analog_updateBatteryVoltage();
#ifdef USE_MK3MAG
magneticHeading = volatileMagneticHeading;
418,7 → 418,7
}
for (axis = PITCH; axis <= YAW; axis++) {
gyroOffset.offsets[axis] = (offsets[axis] + GYRO_OFFSET_CYCLES / 2) / GYRO_OFFSET_CYCLES;
gyroOffset.offsets[axis] = (offsets[axis] + OFFSET_CYCLES / 2) / OFFSET_CYCLES;
int16_t min = (512-200) * GYRO_OVERSAMPLING;
int16_t max = (512+200) * GYRO_OVERSAMPLING;
if(gyroOffset.offsets[axis] < min || gyroOffset.offsets[axis] > max)
428,7 → 428,7
airpressureOffset = (offsets[3] + OFFSET_CYCLES / 2) / OFFSET_CYCLES;
int16_t min = 200;
int16_t max = (1024-200) * 2;
if(airpressure < min || airpressure > max)
if(airpressureOffset < min || airpressureOffset > max)
versionInfo.hardwareErrors[0] |= FC_ERROR0_PRESSURE;
 
gyroOffset_writeToEEProm();