AP_FrSky_Telem: fixed sending last message chunk

Was sent only once, now sent 3 times (as planned)
This commit is contained in:
floaledm 2016-08-23 19:15:13 -05:00 committed by Andrew Tridgell
parent 893614897e
commit 2f54e67996

View File

@ -481,9 +481,11 @@ uint32_t AP_Frsky_Telem::get_next_msg_chunk(void)
}
}
_msg_chunk.repeats++;
if (_msg_chunk.repeats > 2) {
if (_msg_chunk.repeats > 2) { // repeat each message chunk 3 times to ensure transmission
_msg_chunk.repeats = 0;
_msg.sent_idx = (_msg.sent_idx + 1) % MSG_BUFFER_LENGTH;
if (_msg_chunk.char_index == 0) { // if we're ready for the next message
_msg.sent_idx = (_msg.sent_idx + 1) % MSG_BUFFER_LENGTH; // flag the current message as sent
}
}
return _msg_chunk.chunk;
}