Skip to content

Commit

Permalink
Reporting VERSION on Stopped screen (#45)
Browse files Browse the repository at this point in the history
* Fixed display flickering

* Version

* Added version string

Co-authored-by: sean-kelly <sean.kelly@xero.com>
  • Loading branch information
skelstar and sean-kelly authored Jun 3, 2021
1 parent e3d1b6f commit 6cf8640
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions include/display/screens.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,21 @@ namespace Display
tft.drawString(buff, x, y - 4);

y += 30;
tft.setTextColor(TFT_DARKGREY);

tft.setTextColor(TFT_LIGHTGREY);
tft.setFreeFont(FONT_MED);
tft.setTextDatum(TC_DATUM);
tft.setTextDatum(TL_DATUM);
tft.setTextColor(TFT_DARKGREY);

char vbuff[10];
sprintf(vbuff, "v%.1f", VERSION);
tft.drawString(vbuff, 0, y);
x = tft.textWidth(vbuff) + 10;

std::string s(GIT_BRANCH_NAME);
if (s.length() > 20)
s = s.substr(0, 20) + "..."; // truncate and add "..."
tft.drawString(s.c_str(), LCD_WIDTH / 2, y);
tft.drawString(s.c_str(), x, y);

give(mux_SPI);
}
Expand Down

0 comments on commit 6cf8640

Please sign in to comment.