diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-06-25 17:05:20 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-06-25 17:05:20 +0200 |
commit | f9d5cf332c9e60661c2e1c0827c84480e49d4fe8 (patch) | |
tree | 9cbf67deff91c49a4e6dea6340641c5bf29db937 | |
parent | 68442e31ac6970be91592282c9b70ebc76fa142d (diff) | |
download | px4-firmware-f9d5cf332c9e60661c2e1c0827c84480e49d4fe8.tar.gz px4-firmware-f9d5cf332c9e60661c2e1c0827c84480e49d4fe8.tar.bz2 px4-firmware-f9d5cf332c9e60661c2e1c0827c84480e49d4fe8.zip |
Revert "Hotfix: Only orb_copy items in mavlink app if the timestamp changed"
This reverts commit a9653fa10db3884d3d17ee33f80f23aa2e3ef842.
-rw-r--r-- | src/modules/mavlink/mavlink_orb_subscription.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/modules/mavlink/mavlink_orb_subscription.cpp b/src/modules/mavlink/mavlink_orb_subscription.cpp index 3807323c2..901fa8f05 100644 --- a/src/modules/mavlink/mavlink_orb_subscription.cpp +++ b/src/modules/mavlink/mavlink_orb_subscription.cpp @@ -44,8 +44,6 @@ #include <uORB/uORB.h> #include <stdio.h> -#include <systemlib/err.h> - #include "mavlink_orb_subscription.h" MavlinkOrbSubscription::MavlinkOrbSubscription(const orb_id_t topic) : @@ -79,23 +77,21 @@ MavlinkOrbSubscription::update(uint64_t *time, void* data) time_topic = 0; } - if (time_topic != *time) { - - if (orb_copy(_topic, _fd, data)) { - /* error copying topic data */ - memset(data, 0, _topic->o_size); - //warnx("err copy, fd: %d, obj: %s, size: %d", _fd, _topic->o_name, _topic->o_size); - return false; + if (orb_copy(_topic, _fd, data)) { + /* error copying topic data */ + memset(data, 0, _topic->o_size); + return false; - } else { - /* data copied successfully */ - _published = true; + } else { + /* data copied successfully */ + _published = true; + if (time_topic != *time) { *time = time_topic; return true; - } - } else { - return false; + } else { + return false; + } } } |