From 497a2107429eee8e85d007b96ae77aebf96647cc Mon Sep 17 00:00:00 2001 From: Michael Schaeuble Date: Mon, 27 Feb 2017 18:21:25 +0100 Subject: [PATCH] lis3mdl: Fix check_calibration() output The previous implementation returned OK when the sensor was not calibrated and vice versa. This fixes a preflight fail due to selftest failed. --- src/drivers/lis3mdl/lis3mdl.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/drivers/lis3mdl/lis3mdl.cpp b/src/drivers/lis3mdl/lis3mdl.cpp index 72474f08a2..e7b4fdf5ae 100644 --- a/src/drivers/lis3mdl/lis3mdl.cpp +++ b/src/drivers/lis3mdl/lis3mdl.cpp @@ -1228,12 +1228,7 @@ int LIS3MDL::check_calibration() } /* return 0 if calibrated, 1 else */ - if (!_calibrated) { - return 0; - - } else { - return 1; - } + return !_calibrated; } int LIS3MDL::set_excitement(unsigned enable)