forked from Archive/PX4-Autopilot
Revert "Hotfix: Only orb_copy items in mavlink app if the timestamp changed"
This reverts commit a9653fa10d
.
This commit is contained in:
parent
68442e31ac
commit
f9d5cf332c
|
@ -44,8 +44,6 @@
|
||||||
#include <uORB/uORB.h>
|
#include <uORB/uORB.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <systemlib/err.h>
|
|
||||||
|
|
||||||
#include "mavlink_orb_subscription.h"
|
#include "mavlink_orb_subscription.h"
|
||||||
|
|
||||||
MavlinkOrbSubscription::MavlinkOrbSubscription(const orb_id_t topic) :
|
MavlinkOrbSubscription::MavlinkOrbSubscription(const orb_id_t topic) :
|
||||||
|
@ -79,25 +77,23 @@ MavlinkOrbSubscription::update(uint64_t *time, void* data)
|
||||||
time_topic = 0;
|
time_topic = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (time_topic != *time) {
|
|
||||||
|
|
||||||
if (orb_copy(_topic, _fd, data)) {
|
if (orb_copy(_topic, _fd, data)) {
|
||||||
/* error copying topic data */
|
/* error copying topic data */
|
||||||
memset(data, 0, _topic->o_size);
|
memset(data, 0, _topic->o_size);
|
||||||
//warnx("err copy, fd: %d, obj: %s, size: %d", _fd, _topic->o_name, _topic->o_size);
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* data copied successfully */
|
/* data copied successfully */
|
||||||
_published = true;
|
_published = true;
|
||||||
|
if (time_topic != *time) {
|
||||||
*time = time_topic;
|
*time = time_topic;
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
MavlinkOrbSubscription::update(void* data)
|
MavlinkOrbSubscription::update(void* data)
|
||||||
|
|
Loading…
Reference in New Issue