mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 05:11:36 +08:00
sensors : fix race condition triggered by slow-to-boot external sensors
This commit is contained in:
committed by
Lorenz Meier
parent
feeb3ea18d
commit
e4a221bd92
@@ -722,6 +722,11 @@ void VotedSensorsUpdate::mag_poll(struct sensor_combined_s &raw)
|
|||||||
|
|
||||||
// First publication with data
|
// First publication with data
|
||||||
if (_mag.priority[uorb_index] == 0) {
|
if (_mag.priority[uorb_index] == 0) {
|
||||||
|
|
||||||
|
// Parameters update to get offsets and scaling loaded (if not already loaded)
|
||||||
|
parameters_update();
|
||||||
|
|
||||||
|
// Set device priority for the voter
|
||||||
int32_t priority = 0;
|
int32_t priority = 0;
|
||||||
orb_priority(_mag.subscription[uorb_index], &priority);
|
orb_priority(_mag.subscription[uorb_index], &priority);
|
||||||
_mag.priority[uorb_index] = (uint8_t)priority;
|
_mag.priority[uorb_index] = (uint8_t)priority;
|
||||||
|
|||||||
Reference in New Issue
Block a user