AP_Button: check for space before sending BUTTON_CHANGE

This commit is contained in:
Andrew Tridgell 2016-07-24 07:48:36 +10:00
parent 65038c753c
commit 8e959d4704
1 changed files with 6 additions and 4 deletions

View File

@ -151,10 +151,12 @@ void AP_Button::send_report(void)
continue; continue;
} }
mavlink_channel_t chan = (mavlink_channel_t)i; mavlink_channel_t chan = (mavlink_channel_t)i;
mavlink_msg_button_change_send(chan, if (HAVE_PAYLOAD_SPACE(chan, BUTTON_CHANGE)) {
now, mavlink_msg_button_change_send(chan,
(uint32_t)last_change_time_ms, now,
last_mask); (uint32_t)last_change_time_ms,
last_mask);
}
} }
} }