AntennaTracker: fixed mode set using custom mode

This commit is contained in:
Andrew Tridgell 2014-03-31 17:48:05 +11:00
parent 563cf06624
commit 4cb9d4fcb5
1 changed files with 23 additions and 0 deletions

View File

@ -852,6 +852,29 @@ mission_failed:
break;
}
case MAVLINK_MSG_ID_SET_MODE:
{
// decode
mavlink_set_mode_t packet;
mavlink_msg_set_mode_decode(msg, &packet);
if (!(packet.base_mode & MAV_MODE_FLAG_CUSTOM_MODE_ENABLED)) {
// we ignore base_mode as there is no sane way to map
// from that bitmap to a APM flight mode. We rely on
// custom_mode instead.
break;
}
switch (packet.custom_mode) {
case MANUAL:
case STOP:
case AUTO:
set_mode((enum ControlMode)packet.custom_mode);
break;
}
break;
}
default:
break;