1
0
Fork 0
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:
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; 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;
} }