Fixed hardfault on fast proc

_baro_topic can be null in init sequence
   init call collect before the topic is inited.

I think this pattern is repeated in other drivers. I would suggest
allowing null in orb_publish to just return.
This commit is contained in:
David Sidrane 2016-10-21 15:59:34 -10:00 committed by Lorenz Meier
parent b75ff417ea
commit bdfb2bbb8d

View File

@ -800,7 +800,7 @@ MS5611::collect()
report.altitude = (((pow((p / p1), (-(a * R) / g))) * T1) - T1) / a;
/* publish it */
if (!(_pub_blocked)) {
if (!(_pub_blocked) && _baro_topic != nullptr) {
/* publish it */
orb_publish(ORB_ID(sensor_baro), _baro_topic, &report);
}