sensors : fix race condition triggered by slow-to-boot external sensors

This commit is contained in:
Mohammed Kabir
2017-06-14 19:53:07 +02:00
committed by Lorenz Meier
parent 51b23f0b57
commit 5a96490c68
@@ -740,6 +740,11 @@ void VotedSensorsUpdate::mag_poll(struct sensor_combined_s &raw)
// First publication with data
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;
orb_priority(_mag.subscription[uorb_index], &priority);
_mag.priority[uorb_index] = (uint8_t)priority;