diff --git a/libraries/AP_Button/AP_Button.cpp b/libraries/AP_Button/AP_Button.cpp index 8c8bd4a822..0d2a294857 100644 --- a/libraries/AP_Button/AP_Button.cpp +++ b/libraries/AP_Button/AP_Button.cpp @@ -151,10 +151,12 @@ void AP_Button::send_report(void) continue; } mavlink_channel_t chan = (mavlink_channel_t)i; - mavlink_msg_button_change_send(chan, - now, - (uint32_t)last_change_time_ms, - last_mask); + if (HAVE_PAYLOAD_SPACE(chan, BUTTON_CHANGE)) { + mavlink_msg_button_change_send(chan, + now, + (uint32_t)last_change_time_ms, + last_mask); + } } }