Browse Source

AP_FrSky_Telem: fixed sending last message chunk

Was sent only once, now sent 3 times (as planned)
master
floaledm 9 years ago committed by Andrew Tridgell
parent
commit
2f54e67996
  1. 6
      libraries/AP_Frsky_Telem/AP_Frsky_Telem.cpp

6
libraries/AP_Frsky_Telem/AP_Frsky_Telem.cpp

@ -481,9 +481,11 @@ uint32_t AP_Frsky_Telem::get_next_msg_chunk(void) @@ -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;
}

Loading…
Cancel
Save