Skip to content

Commit

Permalink
Fixed use of 'abs()' for floats.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeller committed Nov 29, 2019
1 parent 9637aba commit 935a684
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -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)) \
Expand Down
2 changes: 1 addition & 1 deletion src/main/sensors/gyro.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 935a684

Please sign in to comment.