From cfe7272050de81cbdaee97b6ffbebe5b0edf3b34 Mon Sep 17 00:00:00 2001 From: Nicola De Pasquale Date: Fri, 13 Mar 2020 23:40:02 +0100 Subject: [PATCH] moved some variables --- src/main/fc/rc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/fc/rc.c b/src/main/fc/rc.c index 3adb936611..e07e5abfb8 100644 --- a/src/main/fc/rc.c +++ b/src/main/fc/rc.c @@ -233,7 +233,6 @@ float getRcCurveSlope(int axis, float deflection) static void calculateSetpointRate(int axis) { float angleRate; - float rcCommandf; #ifdef USE_GPS_RESCUE if ((axis == FD_YAW) && FLIGHT_MODE(GPS_RESCUE_MODE)) { @@ -248,6 +247,7 @@ static void calculateSetpointRate(int axis) #endif { // scale rcCommandf to range [-1.0, 1.0] + float rcCommandf; if (axis == FD_YAW) { rcCommandf = rcCommand[axis] / rcCommandYawDivider; } else { @@ -690,10 +690,9 @@ FAST_CODE void processRcCommand(void) #ifdef USE_INTERPOLATED_SP if (isRxDataNew) { - float rcCommandf; - for (int i = FD_ROLL; i <= FD_YAW; i++) { oldRcCommand[i] = rcCommand[i]; + float rcCommandf; if (i == FD_YAW) { rcCommandf = rcCommand[i] / rcCommandYawDivider; } else {