From 3813c5027ffda5ad2e2b7be0cb4dd7579dd2d48b Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Mon, 21 Apr 2014 16:16:28 +0100 Subject: [PATCH] Allow user provided sensor alignment to override NAZE defaults. This should have been in 297609d4c30adf3d278a7ba75036152c36e5e93b. --- src/sensors_initialisation.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/sensors_initialisation.c b/src/sensors_initialisation.c index bb3e4499e7..266235949a 100755 --- a/src/sensors_initialisation.c +++ b/src/sensors_initialisation.c @@ -118,6 +118,17 @@ retry: } #endif + if (mcfg.gyro_align != ALIGN_DEFAULT) { + gyroAlign = mcfg.gyro_align; + } + if (mcfg.acc_align != ALIGN_DEFAULT) { + accAlign = mcfg.acc_align; + } + if (mcfg.mag_align != ALIGN_DEFAULT) { + magAlign = mcfg.mag_align; + } + + // Now time to init things, acc first if (sensors(SENSOR_ACC)) acc.init();