Sub: move handling of PREFLIGHT_SET_SENSOR_OFFSETS up
This commit is contained in:
parent
7f0cb82797
commit
979f6a1980
@ -1230,22 +1230,6 @@ void GCS_MAVLINK_Sub::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) {
|
||||
sub.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
|
||||
|
Loading…
Reference in New Issue
Block a user