Fixed use of 'abs()' for floats. (#9242)

Fixed use of 'abs()' for floats.
This commit is contained in:
Michael Keller 2019-12-01 00:02:23 +13:00 committed by GitHub
commit cb538ea2ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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)) \

View File

@ -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;
}