Skip to content

Commit 428ac7c

Browse files
committed
Only nudge SIV on 64x48 display
1 parent ac9554d commit 428ac7c

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

Firmware/RTK_Everywhere/Display.ino

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,10 +1711,28 @@ displayCoords paintSIVIcon(std::vector<iconPropertyBlinking> *iconList, const ic
17111711

17121712
void nudgeAndPrintSIV(displayCoords textCoords, uint8_t siv)
17131713
{
1714-
oled->setCursor(textCoords.x - 1, textCoords.y); // x, y
1715-
oled->print(siv / 10);
1716-
oled->setCursor(textCoords.x + 7, textCoords.y); // x, y
1717-
oled->print(siv % 10);
1714+
if (present.display_type == DISPLAY_64x48)
1715+
{
1716+
// Always nudge, even if 1 digit, to avoid small jump when
1717+
// siv goes into 2 digits
1718+
oled->setCursor(textCoords.x - 1, textCoords.y); // x, y
1719+
if (siv >= 10)
1720+
{
1721+
oled->print(siv / 10);
1722+
oled->setCursor(textCoords.x + 7, textCoords.y); // x, y
1723+
oled->print(siv % 10);
1724+
}
1725+
else
1726+
{
1727+
oled->print(siv); // Left-justify 1 digit
1728+
}
1729+
}
1730+
else
1731+
{
1732+
// On 128x64, there's no need to nudge
1733+
oled->setCursor(textCoords.x, textCoords.y); // x, y
1734+
oled->print(siv); // 1 or 2 digits
1735+
}
17181736
}
17191737

17201738
void paintSIVText(displayCoords textCoords)
@@ -1738,7 +1756,7 @@ void paintSIVText(displayCoords textCoords)
17381756
if (inBaseMode() == true)
17391757
nudgeAndPrintSIV(textCoords, siv);
17401758
else if (gnss->isFixed() == false)
1741-
oled->print("0");
1759+
nudgeAndPrintSIV(textCoords, 0);
17421760
else
17431761
nudgeAndPrintSIV(textCoords, siv);
17441762

0 commit comments

Comments
 (0)