Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2128 → Rev 2129

/branches/dongfang_FC_fixedwing/arduino_atmega328/analog.c
41,7 → 41,7
/*
* Airspeed
*/
uint32_t airpressure;
int16_t airpressure;
uint16_t airspeedVelocity = 0;
//int16_t airpressureWindow[AIRPRESSURE_WINDOW_LENGTH];
//uint8_t airpressureWindowIdx = 0;
211,6 → 211,7
}
 
void startAnalogConversionCycle(void) {
twimaster_startCycle();
// Stop the sampling. Cycle is over.
for (uint8_t i = 0; i<8; i++) {
ADSensorInputs[i] = 0;
220,7 → 221,6
adChannel = AD_AIRPRESSURE;
ADMUX = (ADMUX & 0xE0) | adChannel;
startADC();
twimaster_startCycle();
sensorDataReady = 0;
}
 
301,7 → 301,7
}
 
// probably wanna aim at 1/10 m/s/unit.
#define LOG_AIRSPEED_FACTOR 2
#define LOG_AIRSPEED_FACTOR 0
 
void analog_updateAirspeed(void) {
uint16_t rawAirpressure = ADSensorInputs[AD_AIRPRESSURE];
369,7 → 369,7
}
 
void analog_calibrate(void) {
#define OFFSET_CYCLES 32
#define OFFSET_CYCLES 120
uint8_t i, axis;
int32_t offsets[4] = { 0, 0, 0, 0};