mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 18:03:35 +08:00
fix hc_sr04 and srf02_i2c subsystem_info init
This commit is contained in:
committed by
Lorenz Meier
parent
20a59b8886
commit
a0b818096b
@@ -659,12 +659,12 @@ HC_SR04::start()
|
||||
|
||||
|
||||
/* notify about state change */
|
||||
struct subsystem_info_s info = {
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
SUBSYSTEM_TYPE_RANGEFINDER
|
||||
};
|
||||
struct subsystem_info_s info = {};
|
||||
info.present = true;
|
||||
info.enabled = true;
|
||||
info.ok = true;
|
||||
info.subsystem_type = SUBSYSTEM_TYPE_RANGEFINDER;
|
||||
|
||||
static orb_advert_t pub = nullptr;
|
||||
|
||||
if (pub != nullptr) {
|
||||
|
||||
@@ -620,18 +620,17 @@ SRF02_I2C::start()
|
||||
work_queue(HPWORK, &_work, (worker_t)&SRF02_I2C::cycle_trampoline, this, 5);
|
||||
|
||||
/* notify about state change */
|
||||
struct subsystem_info_s info = {
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
subsystem_info_s::SUBSYSTEM_TYPE_RANGEFINDER
|
||||
};
|
||||
struct subsystem_info_s info = {};
|
||||
info.present = true;
|
||||
info.enabled = true;
|
||||
info.ok = true;
|
||||
info.subsystem_type = subsystem_info_s::SUBSYSTEM_TYPE_RANGEFINDER;
|
||||
|
||||
static orb_advert_t pub = nullptr;
|
||||
|
||||
if (pub != nullptr) {
|
||||
orb_publish(ORB_ID(subsystem_info), pub, &info);
|
||||
|
||||
|
||||
} else {
|
||||
pub = orb_advertise(ORB_ID(subsystem_info), &info);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user