From 6ca39c6ad16d7bd81f292b400dbbaaf0b40a8924 Mon Sep 17 00:00:00 2001 From: Nicola De Pasquale Date: Sun, 17 Mar 2019 00:32:44 +0100 Subject: [PATCH] moved discentDistance to the beginning of the function --- src/main/flight/gps_rescue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/flight/gps_rescue.c b/src/main/flight/gps_rescue.c index fa960129d..bf283ef24 100644 --- a/src/main/flight/gps_rescue.c +++ b/src/main/flight/gps_rescue.c @@ -470,6 +470,8 @@ static bool checkGPSRescueIsAvailable(void) */ void updateGPSRescueState(void) { + static uint16_t descentDistance; + if (!FLIGHT_MODE(GPS_RESCUE_MODE)) { rescueStop(); } else if (FLIGHT_MODE(GPS_RESCUE_MODE) && rescueState.phase == RESCUE_IDLE) { @@ -484,8 +486,6 @@ void updateGPSRescueState(void) rescueState.isAvailable = checkGPSRescueIsAvailable(); - static uint16_t descentDistance; - switch (rescueState.phase) { case RESCUE_IDLE: idleTasks();