Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2132 → Rev 2133

/branches/dongfang_FC_fixedwing/arduino_atmega328/analog.c
23,10 → 23,8
#define startADC() (ADCSRA |= (1<<ADEN)|(1<<ADSC)|(1<<ADIE))
 
const char* recal = ", recalibration needed.";
 
volatile uint16_t ADSensorInputs[8];
 
 
/*
* These 4 exported variables are zero-offset. The "PID" ones are used
* in the attitude control as rotation rates. The "ATT" ones are for
180,6 → 178,8
 
startAnalogConversionCycle();
 
twimaster_init();
 
// restore global interrupt flags
SREG = sreg;
}
187,8 → 187,8
/*
* Here the axes of the sensor can be shuffled around.
*/
uint16_t rawGyroValue(uint8_t axis) {
return IMU3200SensorInputs[axis+1]; // skip temperature mesaurement in any case..
int16_t rawGyroValue(uint8_t axis) {
return ITG3200SensorInputs[axis+1]; // skip temperature mesaurement in any case..
}
 
/*
350,8 → 350,8
 
if (gyroOffset_readFromEEProm()) {
printf("gyro offsets invalid%s",recal);
gyroOffset.offsets[PITCH] = gyroOffset.offsets[ROLL] = 512 * GYRO_OVERSAMPLING;
gyroOffset.offsets[YAW] = 512 * GYRO_OVERSAMPLING;
gyroOffset.offsets[PITCH] = gyroOffset.offsets[ROLL] = 0;
gyroOffset.offsets[YAW] = 0;
}
 
// Noise is relative to offset. So, reset noise measurements when changing offsets.