Merge pull request #1076 from PX4/mavlinkrevert

Revert "Hotfix: Only orb_copy items in mavlink app if the timestamp changed"
This commit is contained in:
Lorenz Meier 2014-06-25 22:37:19 +02:00
commit 3e0c318311
1 changed files with 13 additions and 17 deletions

View File

@ -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;
} else {
/* data copied successfully */
_published = true;
*time = time_topic;
return true;
}
if (orb_copy(_topic, _fd, data)) {
/* error copying topic data */
memset(data, 0, _topic->o_size);
return false;
} else {
return false;
/* data copied successfully */
_published = true;
if (time_topic != *time) {
*time = time_topic;
return true;
} else {
return false;
}
}
}