From 716eea26ffb717d87ebf16b47589f8637d690466 Mon Sep 17 00:00:00 2001 From: Nicola De Pasquale Date: Sat, 29 Jun 2019 19:39:57 +0200 Subject: [PATCH] requested changes [ci skip] --- src/main/flight/gps_rescue.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/main/flight/gps_rescue.c b/src/main/flight/gps_rescue.c index 8bca3f84d2..cc9a95d363 100644 --- a/src/main/flight/gps_rescue.c +++ b/src/main/flight/gps_rescue.c @@ -304,9 +304,7 @@ static void rescueAttainPosition() setBearing(rescueState.sensor.directionToHome); } - if (debugMode == DEBUG_RTH) { - DEBUG_SET(DEBUG_RTH, 3, rescueState.failure); //Failure can change with no new GPS Data - } + DEBUG_SET(DEBUG_RTH, 3, rescueState.failure); //Failure can change with no new GPS Data if (!newGPSData) { return; @@ -370,18 +368,14 @@ static void rescueAttainPosition() rescueThrottle = constrain(1000 + altitudeAdjustment + hoverAdjustment, gpsRescueConfig()->throttleMin, gpsRescueConfig()->throttleMax); - if (debugMode == DEBUG_RTH) { - DEBUG_SET(DEBUG_RTH, 0, rescueThrottle); - DEBUG_SET(DEBUG_RTH, 1, gpsRescueAngle[AI_PITCH]); - DEBUG_SET(DEBUG_RTH, 2, altitudeAdjustment); - } + DEBUG_SET(DEBUG_RTH, 0, rescueThrottle); + DEBUG_SET(DEBUG_RTH, 1, gpsRescueAngle[AI_PITCH]); + DEBUG_SET(DEBUG_RTH, 2, altitudeAdjustment); - if (debugMode == DEBUG_GPS_RESCUE_THROTTLE_PID) { - DEBUG_SET(DEBUG_GPS_RESCUE_THROTTLE_PID, 0, throttle.Kp * zVelocityError); - DEBUG_SET(DEBUG_GPS_RESCUE_THROTTLE_PID, 1, throttle.Ki * zVelocityIntegral); - DEBUG_SET(DEBUG_GPS_RESCUE_THROTTLE_PID, 2, throttle.Kd * zVelocityDerivative); - DEBUG_SET(DEBUG_GPS_RESCUE_THROTTLE_PID, 3, rescueState.sensor.zVelocity); - } + DEBUG_SET(DEBUG_GPS_RESCUE_THROTTLE_PID, 0, throttle.Kp * zVelocityError); + DEBUG_SET(DEBUG_GPS_RESCUE_THROTTLE_PID, 1, throttle.Ki * zVelocityIntegral); + DEBUG_SET(DEBUG_GPS_RESCUE_THROTTLE_PID, 2, throttle.Kd * zVelocityDerivative); + DEBUG_SET(DEBUG_GPS_RESCUE_THROTTLE_PID, 3, rescueState.sensor.zVelocity); } static void performSanityChecks()