mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 03:03:34 +08:00
mavlink: MavlinkOrbSubscription.update() result fixed
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user