mirror of
https://github.com/opentx/opentx.git
synced 2025-07-17 21:35:27 +03:00
GPS distance is uint16_t
This commit is contained in:
parent
f98585acbe
commit
a021b66a9b
2 changed files with 4 additions and 4 deletions
|
@ -572,8 +572,8 @@ void resetTelemetry()
|
||||||
#ifdef FRSKY_HUB
|
#ifdef FRSKY_HUB
|
||||||
uint16_t sqrt32(uint32_t n)
|
uint16_t sqrt32(uint32_t n)
|
||||||
{
|
{
|
||||||
unsigned int c = 0x8000;
|
uint16_t c = 0x8000;
|
||||||
unsigned int g = 0x8000;
|
uint32_t g = 0x8000;
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
if(g*g > n)
|
if(g*g > n)
|
||||||
|
@ -617,7 +617,7 @@ uint32_t getGpsDistanceX2()
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getGpsDistance()
|
uint16_t getGpsDistance()
|
||||||
{
|
{
|
||||||
return (frskyHubData.pilotLatitude ? sqrt32(getGpsDistanceX2()) : 0);
|
return (frskyHubData.pilotLatitude ? sqrt32(getGpsDistanceX2()) : 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ void resetTelemetry();
|
||||||
#ifdef FRSKY_HUB
|
#ifdef FRSKY_HUB
|
||||||
void getGpsPilotPosition();
|
void getGpsPilotPosition();
|
||||||
uint32_t getGpsDistanceX2();
|
uint32_t getGpsDistanceX2();
|
||||||
uint32_t getGpsDistance();
|
uint16_t getGpsDistance();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue