mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 15:38:53 +08:00
fmu & px4io:Use uORB Publish Auto
This commit is contained in:
committed by
Lorenz Meier
parent
33c9459ebe
commit
a7a1607689
@@ -1749,14 +1749,8 @@ PX4FMU::cycle()
|
||||
#endif // RC_SERIAL_PORT
|
||||
|
||||
if (rc_updated) {
|
||||
/* lazily advertise on first publication */
|
||||
if (_to_input_rc == nullptr) {
|
||||
int instance = _class_instance;
|
||||
_to_input_rc = orb_advertise_multi(ORB_ID(input_rc), &_rc_in, &instance, ORB_PRIO_DEFAULT);
|
||||
|
||||
} else {
|
||||
orb_publish(ORB_ID(input_rc), _to_input_rc, &_rc_in);
|
||||
}
|
||||
int instance = _class_instance;
|
||||
orb_publish_auto(ORB_ID(input_rc), &_to_input_rc, &_rc_in, &instance, ORB_PRIO_DEFAULT);
|
||||
|
||||
} else if (!rc_updated && ((hrt_absolute_time() - _rc_in.timestamp_last_signal) > 1000 * 1000)) {
|
||||
_rc_scan_locked = false;
|
||||
|
||||
@@ -1870,14 +1870,8 @@ PX4IO::io_publish_raw_rc()
|
||||
}
|
||||
}
|
||||
|
||||
/* lazily advertise on first publication */
|
||||
if (_to_input_rc == nullptr) {
|
||||
_to_input_rc = orb_advertise(ORB_ID(input_rc), &rc_val);
|
||||
|
||||
} else {
|
||||
orb_publish(ORB_ID(input_rc), _to_input_rc, &rc_val);
|
||||
}
|
||||
|
||||
int instance = 0;
|
||||
orb_publish_auto(ORB_ID(input_rc), &_to_input_rc, &rc_val, &instance, ORB_PRIO_HIGH);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user