diff options
Diffstat (limited to 'src/modules/mavlink/mavlink_orb_subscription.cpp')
-rw-r--r-- | src/modules/mavlink/mavlink_orb_subscription.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/modules/mavlink/mavlink_orb_subscription.cpp b/src/modules/mavlink/mavlink_orb_subscription.cpp index 996318468..e8f9bb75b 100644 --- a/src/modules/mavlink/mavlink_orb_subscription.cpp +++ b/src/modules/mavlink/mavlink_orb_subscription.cpp @@ -78,12 +78,15 @@ MavlinkOrbSubscription::get_data() bool MavlinkOrbSubscription::update(const hrt_abstime t) { - if (_last_check != t) { + if (_last_check == t) { + /* already checked right now, return result of the check */ + return _updated; + + } else { _last_check = t; - bool updated; - orb_check(_fd, &updated); + orb_check(_fd, &_updated); - if (updated) { + if (_updated) { orb_copy(_topic, _fd, _data); return true; } |