mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 17:55:28 +03:00
Fixing display of negative longitudes.
This commit is contained in:
parent
104b66c755
commit
69a8f302b9
1 changed files with 7 additions and 14 deletions
|
@ -264,20 +264,13 @@ static void osdDrawSingleElement(uint8_t item)
|
||||||
val = gpsSol.llh.lon;
|
val = gpsSol.llh.lon;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val >= 0)
|
char wholeDegreeString[5];
|
||||||
{
|
sprintf(wholeDegreeString, "%d", val / GPS_DEGREES_DIVIDER);
|
||||||
itoa(1000000000 + val, &buff[1], 10);
|
|
||||||
buff[1] = buff[2];
|
char wholeUnshifted[32];
|
||||||
buff[2] = buff[3];
|
sprintf(wholeUnshifted, "%d", val);
|
||||||
buff[3] = '.';
|
|
||||||
}
|
sprintf(buff + 1, "%s.%s", wholeDegreeString, wholeUnshifted + strlen(wholeDegreeString));
|
||||||
else
|
|
||||||
{
|
|
||||||
itoa(-1000000000 + val, &buff[1], 10);
|
|
||||||
buff[2] = buff[3];
|
|
||||||
buff[3] = buff[4];
|
|
||||||
buff[4] = '.';
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue