mavlink: MavlinkOrbSubscription.update() result fixed

This commit is contained in:
Anton Babushkin
2014-03-16 17:10:56 +04:00
parent 3874bca208
commit df5d702bae
2 changed files with 15 additions and 11 deletions
@@ -78,12 +78,15 @@ MavlinkOrbSubscription::get_data()
bool
MavlinkOrbSubscription::update(const hrt_abstime t)
{
if (_last_check != t) {
_last_check = t;
bool updated;
orb_check(_fd, &updated);
if (_last_check == t) {
/* already checked right now, return result of the check */
return _updated;
if (updated) {
} else {
_last_check = t;
orb_check(_fd, &_updated);
if (_updated) {
orb_copy(_topic, _fd, _data);
return true;
}