From 65d74fd6a7b28946523e0974f5b6fdb291ae833e Mon Sep 17 00:00:00 2001 From: jflyper Date: Thu, 20 Jul 2017 18:32:26 +0900 Subject: [PATCH] Run sensor detection to the end regardless of the gyro detection stataus Is it harmful for drivers that handle mag inside the gyro chip? --- src/main/sensors/initialisation.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/sensors/initialisation.c b/src/main/sensors/initialisation.c index bbccc94143..4a59bf88f4 100755 --- a/src/main/sensors/initialisation.c +++ b/src/main/sensors/initialisation.c @@ -56,12 +56,14 @@ static bool sonarDetect(void) bool sensorsAutodetect(void) { - // gyro must be initialised before accelerometer - if (!gyroInit()) { - return false; - } - accInit(gyro.targetLooptime); + // gyro must be initialised before accelerometer + + bool gyroDetected = gyroInit(); + + if (gyroDetected) { + accInit(gyro.targetLooptime); + } #ifdef MAG compassInit(); @@ -77,5 +79,5 @@ bool sensorsAutodetect(void) } #endif - return true; + return gyroDetected; }