From df2ad183e3284c7526a43dc6f89ffb2d8303d337 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Mon, 9 Feb 2015 16:52:34 +0100 Subject: [PATCH] Initialize error counts high enough --- src/modules/sensors/sensors.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp index 82671372d3..c5b7a2265f 100644 --- a/src/modules/sensors/sensors.cpp +++ b/src/modules/sensors/sensors.cpp @@ -2074,6 +2074,21 @@ Sensors::task_main() raw.adc_voltage_v[2] = 0.0f; raw.adc_voltage_v[3] = 0.0f; + /* set high initial error counts to deselect gyros */ + raw.gyro_errcount = 100000; + raw.gyro1_errcount = 100000; + raw.gyro2_errcount = 100000; + + /* set high initial error counts to deselect accels */ + raw.accelerometer_errcount = 100000; + raw.accelerometer1_errcount = 100000; + raw.accelerometer2_errcount = 100000; + + /* set high initial error counts to deselect mags */ + raw.magnetometer_errcount = 100000; + raw.magnetometer1_errcount = 100000; + raw.magnetometer2_errcount = 100000; + memset(&_battery_status, 0, sizeof(_battery_status)); _battery_status.voltage_v = -1.0f; _battery_status.voltage_filtered_v = -1.0f;