Store the flight state in the GPS structure

pull/49/head
Pawel Jalocha 2022-05-21 20:28:24 +01:00
rodzic 12bf810436
commit 6b5024970a
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -117,7 +117,7 @@ static uint32_t RndID_TimeToChange = 0;
void FlightProcess(void)
{ bool PrevInFlight=Flight.inFlight();
Flight.Process(GPS_Pos[GPS_PosIdx]);
bool InFlight=Flight.inFlight();
GPS.InFlight=Flight.inFlight();
if(Parameters.AddrType!=0) return;
uint32_t Random = GPS_Random^RX_Random;
if(RndID_TimeToChange==0)
@ -136,7 +136,7 @@ void FlightProcess(void)
// Format_String(CONS_UART_Write, "\n");
xSemaphoreGive(CONS_Mutex); }
RndID_TimeToChange--; }
if(PrevInFlight==1 && InFlight==0) RndID_TimeToChange+=20;
if(PrevInFlight==1 && GPS.InFlight==0) RndID_TimeToChange+=20;
}
// ----------------------------------------------------------------------------

Wyświetl plik

@ -898,6 +898,7 @@ class GPS_Position: public GPS_Time
bool hasGSV :1;
bool isReady :1; // is ready for the following treaement
bool Sent :1; // has been transmitted
bool InFlight :1; // take-off and landing detection
} ;
} ;