Skip to content

Commit

Permalink
Merge pull request mavlink#696 from Susurrus/fix_647
Browse files Browse the repository at this point in the history
Fix for mavlink#647
  • Loading branch information
LorenzMeier committed Jun 11, 2014
2 parents f79ecee + 4b07086 commit d222658
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ui/QGCMAVLinkLogPlayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,18 @@ void QGCMAVLinkLogPlayer::logLoop()
if (mavlinkLogFormat)
{
// Now parse MAVLink messages, grabbing their timestamps as we go. We stop once we
// have at least 3ms until the next one.
// have at least 3ms until the next one.

// We track what the next execution time should be in milliseconds, which we use to set
// the next timer interrupt.
int nextExecutionTime = 0;

// We use the `findNextMavlinkMessage()` function to scan ahead for MAVLink messages. This
// is necessary because we don't know how big each MAVLink message is until we finish parsing
// one, and since we only output arrays of bytes, we need to know the size of that array.
mavlink_message_t msg;
msg.len = 0; // FIXME: Hack, remove once Issue #647 is fixed
findNextMavlinkMessage(&msg);

while (nextExecutionTime < 3) {

// Now we're sitting at the start of a MAVLink message, so read it all into a byte array for feeding to our parser.
Expand Down

0 comments on commit d222658

Please sign in to comment.