mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
GCS_MAVLink: add AP_MAVLINK_BATTERY2_ENABLED define
on by default but can be turned off in next stable
This commit is contained in:
parent
ae1bddfb00
commit
f75f68c2f1
@ -289,7 +289,9 @@ public:
|
||||
void send_simstate() const;
|
||||
void send_sim_state() const;
|
||||
void send_ahrs();
|
||||
#if AP_MAVLINK_BATTERY2_ENABLED
|
||||
void send_battery2();
|
||||
#endif
|
||||
#if AP_OPTICALFLOW_ENABLED
|
||||
void send_opticalflow();
|
||||
#endif
|
||||
|
@ -933,7 +933,9 @@ ap_message GCS_MAVLINK::mavlink_id_to_ap_message_id(const uint32_t mavlink_id) c
|
||||
{ MAVLINK_MSG_ID_DISTANCE_SENSOR, MSG_DISTANCE_SENSOR},
|
||||
// request also does report:
|
||||
{ MAVLINK_MSG_ID_TERRAIN_REQUEST, MSG_TERRAIN},
|
||||
#if AP_MAVLINK_BATTERY2_ENABLED
|
||||
{ MAVLINK_MSG_ID_BATTERY2, MSG_BATTERY2},
|
||||
#endif
|
||||
{ MAVLINK_MSG_ID_CAMERA_FEEDBACK, MSG_CAMERA_FEEDBACK},
|
||||
#if HAL_MOUNT_ENABLED
|
||||
{ MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS, MSG_GIMBAL_DEVICE_ATTITUDE_STATUS},
|
||||
@ -2325,6 +2327,7 @@ void GCS::setup_uarts()
|
||||
#endif
|
||||
}
|
||||
|
||||
#if AP_MAVLINK_BATTERY2_ENABLED
|
||||
// report battery2 state
|
||||
void GCS_MAVLINK::send_battery2()
|
||||
{
|
||||
@ -2342,6 +2345,7 @@ void GCS_MAVLINK::send_battery2()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif // AP_MAVLINK_BATTERY2_ENABLED
|
||||
|
||||
/*
|
||||
handle a SET_MODE MAVLink message
|
||||
@ -5468,10 +5472,12 @@ bool GCS_MAVLINK::try_send_message(const enum ap_message id)
|
||||
send_battery_status();
|
||||
break;
|
||||
|
||||
#if AP_MAVLINK_BATTERY2_ENABLED
|
||||
case MSG_BATTERY2:
|
||||
CHECK_PAYLOAD_SIZE(BATTERY2);
|
||||
send_battery2();
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MSG_EKF_STATUS_REPORT:
|
||||
CHECK_PAYLOAD_SIZE(EKF_STATUS_REPORT);
|
||||
|
@ -5,3 +5,8 @@
|
||||
#ifndef HAL_GCS_ENABLED
|
||||
#define HAL_GCS_ENABLED 1
|
||||
#endif
|
||||
|
||||
// BATTERY2 is slated to be removed:
|
||||
#ifndef AP_MAVLINK_BATTERY2_ENABLED
|
||||
#define AP_MAVLINK_BATTERY2_ENABLED 1
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user