Tracker: fix return results from preflight calibration

Was always returning success even in cases where it failed
Issue found by Coverity
This commit is contained in:
Randy Mackay 2016-08-08 11:52:24 +09:00
parent 8bb536b366
commit 0e5a91bb1b
1 changed files with 2 additions and 1 deletions

View File

@ -580,9 +580,11 @@ void GCS_MAVLINK_Tracker::handleMessage(mavlink_message_t* msg)
tracker.init_barometer(false);
// zero the altitude difference on next baro update
tracker.nav_status.need_altitude_calibration = true;
result = MAV_RESULT_ACCEPTED;
}
if (is_equal(packet.param4,1.0f)) {
// Can't trim radio
result = MAV_RESULT_UNSUPPORTED;
} else if (is_equal(packet.param5,1.0f)) {
result = MAV_RESULT_ACCEPTED;
// start with gyro calibration
@ -609,7 +611,6 @@ void GCS_MAVLINK_Tracker::handleMessage(mavlink_message_t* msg)
result = MAV_RESULT_FAILED;
}
}
result = MAV_RESULT_ACCEPTED;
break;
}