diff --git a/src/modules/px4iofirmware/mixer.cpp b/src/modules/px4iofirmware/mixer.cpp index 0c02c321daec..7aec22234b00 100644 --- a/src/modules/px4iofirmware/mixer.cpp +++ b/src/modules/px4iofirmware/mixer.cpp @@ -66,7 +66,6 @@ extern "C" { * Maximum interval in us before FMU signal is considered lost */ #define FMU_INPUT_DROP_LIMIT_US 500000 -#define NAN_VALUE (0.0f/0.0f) /* current servo arm/disarm state */ static volatile bool mixer_servos_armed = false; @@ -479,7 +478,7 @@ mixer_callback(uintptr_t handle, control_group == actuator_controls_s::GROUP_INDEX_ATTITUDE_ALTERNATE) && control_index == actuator_controls_s::INDEX_THROTTLE) { /* mark the throttle as invalid */ - control = NAN_VALUE; + control = NAN; } } diff --git a/src/systemcmds/tests/test_mixer.cpp b/src/systemcmds/tests/test_mixer.cpp index 5b0cf38a5174..967b65d491e1 100644 --- a/src/systemcmds/tests/test_mixer.cpp +++ b/src/systemcmds/tests/test_mixer.cpp @@ -37,22 +37,10 @@ * Mixer load test */ -#include - -#include - -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include +#include #include #include #include @@ -75,8 +63,6 @@ const unsigned output_max = 8; static float actuator_controls[output_max]; static bool should_prearm = false; -#define NAN_VALUE (0.0f/0.0f) - #ifdef __PX4_DARWIN #define MIXER_DIFFERENCE_THRESHOLD 30 #else @@ -604,7 +590,7 @@ mixer_callback(uintptr_t handle, uint8_t control_group, uint8_t control_index, f if (should_prearm && control_group == actuator_controls_s::GROUP_INDEX_ATTITUDE && control_index == actuator_controls_s::INDEX_THROTTLE) { - control = NAN_VALUE; + control = std::numeric_limits::quiet_NaN(); } return 0;