Plane: use HAVE_PAYLOAD_SPACE()
This commit is contained in:
parent
d477ecc24e
commit
eee06da1b5
@ -1148,8 +1148,7 @@ void Plane::set_servos(void)
|
|||||||
#if HIL_SUPPORT
|
#if HIL_SUPPORT
|
||||||
if (g.hil_mode == 1) {
|
if (g.hil_mode == 1) {
|
||||||
// get the servos to the GCS immediately for HIL
|
// get the servos to the GCS immediately for HIL
|
||||||
if (comm_get_txspace(MAVLINK_COMM_0) >=
|
if (HAVE_PAYLOAD_SPACE(MAVLINK_COMM_0, RC_CHANNELS_SCALED)) {
|
||||||
MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES) {
|
|
||||||
send_servo_out(MAVLINK_COMM_0);
|
send_servo_out(MAVLINK_COMM_0);
|
||||||
}
|
}
|
||||||
if (!g.hil_servos) {
|
if (!g.hil_servos) {
|
||||||
|
@ -2198,8 +2198,7 @@ void Plane::gcs_send_airspeed_calibration(const Vector3f &vg)
|
|||||||
{
|
{
|
||||||
for (uint8_t i=0; i<num_gcs; i++) {
|
for (uint8_t i=0; i<num_gcs; i++) {
|
||||||
if (gcs[i].initialised) {
|
if (gcs[i].initialised) {
|
||||||
if (comm_get_txspace((mavlink_channel_t)i) - MAVLINK_NUM_NON_PAYLOAD_BYTES >=
|
if (HAVE_PAYLOAD_SPACE((mavlink_channel_t)i, AIRSPEED_AUTOCAL)) {
|
||||||
MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN) {
|
|
||||||
airspeed.log_mavlink_send((mavlink_channel_t)i, vg);
|
airspeed.log_mavlink_send((mavlink_channel_t)i, vg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user