Copter: send NACK if compass.start_calibration_all fails

This commit is contained in:
Jonathan Challinger 2015-05-04 15:22:37 -07:00 committed by Andrew Tridgell
parent 0edf1df28e
commit eec5c2a5eb
1 changed files with 7 additions and 6 deletions

View File

@ -1479,12 +1479,13 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
float delay = packet.param4;
if (mag_mask == 0) { // 0 means all
compass.start_calibration_all(retry, autosave, delay);
break;
}
if(!compass.start_calibration_mask(mag_mask, retry, autosave, delay)) {
result = MAV_RESULT_FAILED;
if (!compass.start_calibration_all(retry, autosave, delay)) {
result = MAV_RESULT_FAILED;
}
} else {
if (!compass.start_calibration_mask(mag_mask, retry, autosave, delay)) {
result = MAV_RESULT_FAILED;
}
}
break;