mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
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:
parent
b75ff417ea
commit
bdfb2bbb8d
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user