From 9424d17164ca0666e9f755d8623cd47b27021c13 Mon Sep 17 00:00:00 2001 From: Florian Achermann Date: Tue, 27 Jul 2021 13:57:46 +0200 Subject: [PATCH] Change boot order to make sure the adis mag is the priority one --- ROMFS/px4fmu_common/init.d/rc.sensors | 30 +++++++++++++++------------ 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rc.sensors b/ROMFS/px4fmu_common/init.d/rc.sensors index 1d00e00621..453fde9b83 100644 --- a/ROMFS/px4fmu_common/init.d/rc.sensors +++ b/ROMFS/px4fmu_common/init.d/rc.sensors @@ -21,6 +21,23 @@ fi # Begin Optional drivers # ############################################################################### +# ADIS16448 spi external IMU +if param compare -s SENS_EN_ADIS164X 1 +then + if param compare -s SENS_OR_ADIS164X 0 + then + adis16448 -S start + fi + if param compare -s SENS_OR_ADIS164X 4 + then + adis16448 -S start -R 4 + fi + + # add a sleep to make sure the mag is the priority one + usleep 1000000 +fi + + if param compare -s SENS_EN_BATT 1 then batt_smbus start -X @@ -108,19 +125,6 @@ then vl53l1x start -X fi -# ADIS16448 spi external IMU -if param compare -s SENS_EN_ADIS164X 1 -then - if param compare -s SENS_OR_ADIS164X 0 - then - adis16448 -S start - fi - if param compare -s SENS_OR_ADIS164X 4 - then - adis16448 -S start -R 4 - fi -fi - # Hall effect sensors si7210 # Potentially remove the -k option if possible and improve the startup if possible if param greater CAL_AV_AOA_ID -1