Copter: move handling of PREFLIGHT_SET_SENSOR_OFFSETS up

This commit is contained in:
Peter Barker 2017-07-17 11:04:51 +10:00 committed by Francisco Ferreira
parent cee7ce0571
commit ad1c379445
1 changed files with 0 additions and 17 deletions

View File

@ -1214,23 +1214,6 @@ void GCS_MAVLINK_Copter::handleMessage(mavlink_message_t* msg)
}
break;
case MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS:
{
uint8_t compassNumber = -1;
if (is_equal(packet.param1, 2.0f)) {
compassNumber = 0;
} else if (is_equal(packet.param1, 5.0f)) {
compassNumber = 1;
} else if (is_equal(packet.param1, 6.0f)) {
compassNumber = 2;
}
if (compassNumber != (uint8_t) -1) {
copter.compass.set_and_save_offsets(compassNumber, packet.param2, packet.param3, packet.param4);
result = MAV_RESULT_ACCEPTED;
}
break;
}
case MAV_CMD_COMPONENT_ARM_DISARM:
if (is_equal(packet.param1,1.0f)) {
// attempt to arm and return success or failure