reset heading to zero when calibrating gyro w/stick combo on hardware without mag

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@427 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
timecop@gmail.com 2013-10-02 02:29:52 +00:00
parent 3744f36895
commit 891bce4e19
1 changed files with 2 additions and 0 deletions

View File

@ -541,6 +541,8 @@ void loop(void)
GPS_reset_home_position(); GPS_reset_home_position();
if (sensors(SENSOR_BARO)) if (sensors(SENSOR_BARO))
calibratingB = 10; // calibrate baro to new ground level (10 * 25 ms = ~250 ms non blocking) calibratingB = 10; // calibrate baro to new ground level (10 * 25 ms = ~250 ms non blocking)
if (!sensors(SENSOR_MAG))
heading = 0; // reset heading to zero after gyro calibration
// Inflight ACC Calibration // Inflight ACC Calibration
} else if (feature(FEATURE_INFLIGHT_ACC_CAL) && (rcSticks == THR_LO + YAW_LO + PIT_HI + ROL_HI)) { } else if (feature(FEATURE_INFLIGHT_ACC_CAL) && (rcSticks == THR_LO + YAW_LO + PIT_HI + ROL_HI)) {
if (AccInflightCalibrationMeasurementDone) { // trigger saving into eeprom after landing if (AccInflightCalibrationMeasurementDone) { // trigger saving into eeprom after landing