Fix sending first High Latency message

This commit is contained in:
acfloria
2018-06-29 16:49:30 +00:00
committed by Lorenz Meier
parent ca1f7a4a19
commit 17df184953
5 changed files with 39 additions and 2 deletions
+9
View File
@@ -66,6 +66,10 @@ MavlinkStream::update(const hrt_abstime &t)
// on the link scheduling
if (send(t)) {
_last_sent = hrt_absolute_time();
if (!_first_message_sent) {
_first_message_sent = true;
}
}
return 0;
@@ -103,6 +107,11 @@ MavlinkStream::update(const hrt_abstime &t)
// long time not sending anything, sending multiple messages in a short time is avoided.
if (send(t)) {
_last_sent = ((interval > 0) && ((int64_t)(1.5f * interval) > dt)) ? _last_sent + interval : t;
if (!_first_message_sent) {
_first_message_sent = true;
}
return 0;
} else {