Skip to content

Commit

Permalink
Store the flight state in the GPS structure
Browse files Browse the repository at this point in the history
  • Loading branch information
pjalocha committed May 21, 2022
1 parent 12bf810 commit 6b50249
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main/gps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
}

// ----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions main/ogn.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
} ;
} ;

Expand Down

0 comments on commit 6b50249

Please sign in to comment.