From 935a684765aab0ab47b111830a79b74dcf3976a2 Mon Sep 17 00:00:00 2001 From: mikeller Date: Fri, 29 Nov 2019 03:54:14 +1300 Subject: [PATCH] Fixed use of 'abs()' for floats. --- Makefile | 2 +- src/main/sensors/gyro.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b816a2d08..5900d1335 100644 --- a/Makefile +++ b/Makefile @@ -239,7 +239,7 @@ CC_NO_OPTIMISATION := # # Added after GCC version update, remove once the warnings have been fixed # -TEMPORARY_FLAGS := -Wno-absolute-value +TEMPORARY_FLAGS := CFLAGS += $(ARCH_FLAGS) \ $(addprefix -D,$(OPTIONS)) \ diff --git a/src/main/sensors/gyro.c b/src/main/sensors/gyro.c index 006924925..e3b13e0c4 100644 --- a/src/main/sensors/gyro.c +++ b/src/main/sensors/gyro.c @@ -996,7 +996,7 @@ static FAST_CODE void checkForYawSpin(timeUs_t currentTimeUs) } else { #ifndef SIMULATOR_BUILD // check for spin on yaw axis only - if (abs(gyro.gyroADCf[Z]) > gyroConfig()->yaw_spin_threshold) { + if (abs((int)gyro.gyroADCf[Z]) > gyroConfig()->yaw_spin_threshold) { yawSpinDetected = true; yawSpinTimeUs = currentTimeUs; } -- 2.11.4.GIT