mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-24 16:55:29 +03:00
Better implementation
This commit is contained in:
parent
6eaefd9588
commit
beb74e51be
1 changed files with 3 additions and 2 deletions
|
@ -2277,15 +2277,16 @@ static bool osdDrawSingleElement(uint8_t item)
|
|||
int digits = osdConfig()->plus_code_digits;
|
||||
if (STATE(GPS_FIX)) {
|
||||
olc_encode(gpsSol.llh.lat, gpsSol.llh.lon, digits, buff, sizeof(buff));
|
||||
buff[0] = buff[1] = buff[2] = buff[3] = ' ';
|
||||
} else {
|
||||
// +codes with > 8 digits have a + at the 9th digit
|
||||
// and we only support 10 and up.
|
||||
memset(buff, '-', digits + 1);
|
||||
buff[0] = buff[1] = buff[2] = buff[3] = ' ';
|
||||
buff[8] = '+';
|
||||
buff[digits + 1] = '\0';
|
||||
}
|
||||
// Use local code
|
||||
memmove(buff, buff+4, strlen(buff)+4);
|
||||
buff[digits + 1 - 4] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue