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

Fixing display of negative longitudes.

This commit is contained in:
Stewart Loving-Gibbard 2017-05-13 11:37:50 -07:00
parent 104b66c755
commit 69a8f302b9

View file

@ -264,20 +264,13 @@ static void osdDrawSingleElement(uint8_t item)
val = gpsSol.llh.lon;
}
if (val >= 0)
{
itoa(1000000000 + val, &buff[1], 10);
buff[1] = buff[2];
buff[2] = buff[3];
buff[3] = '.';
}
else
{
itoa(-1000000000 + val, &buff[1], 10);
buff[2] = buff[3];
buff[3] = buff[4];
buff[4] = '.';
}
char wholeDegreeString[5];
sprintf(wholeDegreeString, "%d", val / GPS_DEGREES_DIVIDER);
char wholeUnshifted[32];
sprintf(wholeUnshifted, "%d", val);
sprintf(buff + 1, "%s.%s", wholeDegreeString, wholeUnshifted + strlen(wholeDegreeString));
break;
}