mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 19:33:34 +08:00
differential_pressure drivers update orb_publish usage to uORB::PublicationMulti<>
This commit is contained in:
@@ -63,7 +63,6 @@ Airspeed::Airspeed(int bus, int address, unsigned conversion_interval, const cha
|
||||
_measure_interval(0),
|
||||
_collect_phase(false),
|
||||
_diff_pres_offset(0.0f),
|
||||
_airspeed_pub(nullptr),
|
||||
_airspeed_orb_class_instance(-1),
|
||||
_class_instance(-1),
|
||||
_conversion_interval(conversion_interval),
|
||||
@@ -81,8 +80,6 @@ Airspeed::~Airspeed()
|
||||
unregister_class_devname(AIRSPEED_BASE_DEVICE_PATH, _class_instance);
|
||||
}
|
||||
|
||||
orb_unadvertise(_airspeed_pub);
|
||||
|
||||
// free perf counters
|
||||
perf_free(_sample_perf);
|
||||
perf_free(_comms_errors);
|
||||
@@ -101,15 +98,6 @@ Airspeed::init()
|
||||
|
||||
/* advertise sensor topic, measure manually to initialize valid report */
|
||||
measure();
|
||||
differential_pressure_s arp = {};
|
||||
|
||||
/* measurement will have generated a report, publish */
|
||||
_airspeed_pub = orb_advertise_multi(ORB_ID(differential_pressure), &arp, &_airspeed_orb_class_instance,
|
||||
ORB_PRIO_HIGH - _class_instance);
|
||||
|
||||
if (_airspeed_pub == nullptr) {
|
||||
PX4_WARN("uORB started?");
|
||||
}
|
||||
|
||||
return PX4_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user