1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-19 22:35:19 +03:00

Clean/improve GSM SMS telemetry code (#4739)

This commit is contained in:
Michel Pastor 2019-05-25 21:55:01 +02:00 committed by GitHub
parent 73e56da10e
commit 2fe116d2cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 162 additions and 137 deletions

View file

@ -2204,7 +2204,7 @@ static void updateNavigationFlightStatistics(void)
}
}
int32_t getTotalTravelDistance(void)
uint32_t getTotalTravelDistance(void)
{
return lrintf(posControl.totalTripDistance);
}
@ -3226,7 +3226,9 @@ int32_t navigationGetHomeHeading(void)
// returns m/s
float calculateAverageSpeed() {
return (float)getTotalTravelDistance() / (getFlightTime() * 100);
float flightTime = getFlightTime();
if (flightTime == 0.0f) return 0;
return (float)getTotalTravelDistance() / (flightTime * 100);
}
const navigationPIDControllers_t* getNavigationPIDControllers(void) {