fix hc_sr04 and srf02_i2c subsystem_info init

This commit is contained in:
Daniel Agar
2016-04-17 19:02:59 +02:00
committed by Lorenz Meier
parent 20a59b8886
commit a0b818096b
2 changed files with 12 additions and 13 deletions
+6 -6
View File
@@ -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) {
+6 -7
View File
@@ -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);