GCS_MAVLink: remove more compass cal if it is not enabled

This commit is contained in:
Peter Barker 2023-05-29 11:32:15 +10:00 committed by Peter Barker
parent 5a33fc87e4
commit 4ee58c4496
1 changed files with 4 additions and 4 deletions

View File

@ -4410,14 +4410,12 @@ MAV_RESULT GCS_MAVLINK::handle_command_battery_reset(const mavlink_command_long_
return MAV_RESULT_FAILED; return MAV_RESULT_FAILED;
} }
#if COMPASS_CAL_ENABLED
MAV_RESULT GCS_MAVLINK::handle_command_mag_cal(const mavlink_command_long_t &packet) MAV_RESULT GCS_MAVLINK::handle_command_mag_cal(const mavlink_command_long_t &packet)
{ {
#if COMPASS_CAL_ENABLED
return AP::compass().handle_mag_cal_command(packet); return AP::compass().handle_mag_cal_command(packet);
#else
return MAV_RESULT_UNSUPPORTED;
#endif
} }
#endif
#if AP_MAVLINK_MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES_ENABLED #if AP_MAVLINK_MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES_ENABLED
MAV_RESULT GCS_MAVLINK::handle_command_request_autopilot_capabilities(const mavlink_command_long_t &packet) MAV_RESULT GCS_MAVLINK::handle_command_request_autopilot_capabilities(const mavlink_command_long_t &packet)
@ -4650,12 +4648,14 @@ MAV_RESULT GCS_MAVLINK::handle_command_long_packet(const mavlink_command_long_t
break; break;
#endif // HAL_HIGH_LATENCY2_ENABLED #endif // HAL_HIGH_LATENCY2_ENABLED
#if COMPASS_CAL_ENABLED
case MAV_CMD_DO_START_MAG_CAL: case MAV_CMD_DO_START_MAG_CAL:
case MAV_CMD_DO_ACCEPT_MAG_CAL: case MAV_CMD_DO_ACCEPT_MAG_CAL:
case MAV_CMD_DO_CANCEL_MAG_CAL: { case MAV_CMD_DO_CANCEL_MAG_CAL: {
result = handle_command_mag_cal(packet); result = handle_command_mag_cal(packet);
break; break;
} }
#endif
case MAV_CMD_START_RX_PAIR: case MAV_CMD_START_RX_PAIR:
result = handle_rc_bind(packet); result = handle_rc_bind(packet);