1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-16 12:55:12 +03:00

GPS distance is uint16_t

This commit is contained in:
bsongis 2012-02-15 21:02:03 +00:00
parent f98585acbe
commit a021b66a9b
2 changed files with 4 additions and 4 deletions

View file

@ -572,8 +572,8 @@ void resetTelemetry()
#ifdef FRSKY_HUB
uint16_t sqrt32(uint32_t n)
{
unsigned int c = 0x8000;
unsigned int g = 0x8000;
uint16_t c = 0x8000;
uint32_t g = 0x8000;
for(;;) {
if(g*g > n)
@ -617,7 +617,7 @@ uint32_t getGpsDistanceX2()
return result;
}
uint32_t getGpsDistance()
uint16_t getGpsDistance()
{
return (frskyHubData.pilotLatitude ? sqrt32(getGpsDistanceX2()) : 0);
}

View file

@ -158,7 +158,7 @@ void resetTelemetry();
#ifdef FRSKY_HUB
void getGpsPilotPosition();
uint32_t getGpsDistanceX2();
uint32_t getGpsDistance();
uint16_t getGpsDistance();
#endif
#endif