Plane: use HAVE_PAYLOAD_SPACE()

This commit is contained in:
Andrew Tridgell 2016-04-05 14:10:30 +10:00
parent d477ecc24e
commit eee06da1b5
2 changed files with 2 additions and 4 deletions

View File

@ -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) {

View File

@ -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);
} }
} }