From 22e234724f55c272f0774db03acff160c316970f Mon Sep 17 00:00:00 2001 From: acfloria Date: Thu, 1 Mar 2018 17:27:18 +0100 Subject: [PATCH] Update timestamp for last sent message im mavlink stream only if the message was sent --- src/modules/mavlink/mavlink_stream.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/mavlink/mavlink_stream.cpp b/src/modules/mavlink/mavlink_stream.cpp index c16b2ff254..45f716d40d 100644 --- a/src/modules/mavlink/mavlink_stream.cpp +++ b/src/modules/mavlink/mavlink_stream.cpp @@ -79,9 +79,11 @@ MavlinkStream::update(const hrt_abstime t) // this will give different messages on the same run a different // initial timestamp which will help spacing them out // on the link scheduling - _last_sent = hrt_absolute_time(); #ifndef __PX4_QURT - (void)send(t); + if (send(t)) { + _last_sent = hrt_absolute_time(); + } + #endif return 0; }