Abort on large packets which do not fit in buffer - not just if the gap is not provided any more.

This commit is contained in:
Lorenz Meier 2014-10-27 13:10:58 +01:00
parent d5b8385a13
commit 2e33683630
1 changed files with 1 additions and 1 deletions

View File

@ -763,7 +763,7 @@ Mavlink::send_message(const uint8_t msgid, const void *msg)
_last_write_try_time = hrt_absolute_time(); _last_write_try_time = hrt_absolute_time();
/* check if there is space in the buffer, let it overflow else */ /* check if there is space in the buffer, let it overflow else */
if (buf_free < TX_BUFFER_GAP) { if ((buf_free < TX_BUFFER_GAP) || (buf_free < packet_len)) {
/* no enough space in buffer to send */ /* no enough space in buffer to send */
count_txerr(); count_txerr();
count_txerrbytes(packet_len); count_txerrbytes(packet_len);