mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 08:43:33 +08:00
Fixed up init sequence of all sensors - we can publish in interrupt context, but not advertise! All advertisements now contain valid data
This commit is contained in:
@@ -184,18 +184,9 @@ ETSAirspeed::collect()
|
||||
report.voltage = 0;
|
||||
report.max_differential_pressure_pa = _max_differential_pressure_pa;
|
||||
|
||||
/* announce the airspeed if needed, just publish else */
|
||||
if (_class_instance == CLASS_DEVICE_PRIMARY && !(_pub_blocked)) {
|
||||
|
||||
if (_airspeed_pub > 0) {
|
||||
/* publish it */
|
||||
orb_publish(ORB_ID(differential_pressure), _airspeed_pub, &report);
|
||||
} else {
|
||||
_airspeed_pub = orb_advertise(ORB_ID(differential_pressure), &report);
|
||||
|
||||
if (_airspeed_pub < 0)
|
||||
debug("failed to create differential_pressure publication");
|
||||
}
|
||||
if (_airspeed_pub > 0 && !(_pub_blocked)) {
|
||||
/* publish it */
|
||||
orb_publish(ORB_ID(differential_pressure), _airspeed_pub, &report);
|
||||
}
|
||||
|
||||
new_report(report);
|
||||
|
||||
Reference in New Issue
Block a user