Added track # display to the LCD screen.
This commit is contained in:
parent
091c785875
commit
b3088df3d2
5 changed files with 31 additions and 3 deletions
|
@ -185,6 +185,20 @@ void SSD1306::RefreshScreen()
|
|||
}
|
||||
}
|
||||
|
||||
void SSD1306::RefreshRows(u8 start, u8 amountOfRows)
|
||||
{
|
||||
MoveCursorCharacter(start, 0);
|
||||
start *= 128;
|
||||
|
||||
int i;
|
||||
int end = start + amountOfRows * 128;
|
||||
|
||||
for (i = start * 128; i < end; i++)
|
||||
{
|
||||
SendData(frame[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void SSD1306::ClearScreen()
|
||||
{
|
||||
memset(frame, 0, sizeof(frame));
|
||||
|
|
|
@ -25,9 +25,9 @@ extern "C"
|
|||
}
|
||||
|
||||
// 8 pages * (128 columns * 8 bits)
|
||||
//0 127
|
||||
//0 127
|
||||
//0 127
|
||||
//0 127 0 127
|
||||
//0 127 0 127
|
||||
//0 127 0 127
|
||||
//________________________________________________________
|
||||
//7777777 | 7
|
||||
//6666666 | 6
|
||||
|
@ -82,6 +82,7 @@ public:
|
|||
|
||||
void ClearScreen();
|
||||
void RefreshScreen();
|
||||
void RefreshRows(u8 start, u8 amountOfRows);
|
||||
|
||||
protected:
|
||||
void SendCommand(u8 command);
|
||||
|
|
|
@ -97,3 +97,7 @@ void ScreenLCD::SwapBuffers()
|
|||
ssd1306->RefreshScreen();
|
||||
}
|
||||
|
||||
void ScreenLCD::RefreshRows(u8 start, u8 amountOfRows)
|
||||
{
|
||||
ssd1306->RefreshRows(start, amountOfRows);
|
||||
}
|
||||
|
|
|
@ -51,6 +51,8 @@ public:
|
|||
|
||||
void SwapBuffers();
|
||||
|
||||
void RefreshRows(u8 start, u8 amountOfRows);
|
||||
|
||||
private:
|
||||
SSD1306* ssd1306 = 0;
|
||||
};
|
||||
|
|
|
@ -492,6 +492,13 @@ void UpdateScreen()
|
|||
snprintf(tempBuffer, tempBufferSize, "%02d.%d", (oldTrack >> 1) + 1, oldTrack & 1 ? 5 : 0);
|
||||
screen.PrintText(false, 20 * 8, y, tempBuffer, textColour, bgColour);
|
||||
//refreshUartStatusDisplay = true;
|
||||
|
||||
if (screenLCD)
|
||||
{
|
||||
screenLCD->PrintText(false, 0, 0, tempBuffer, RGBA(0xff, 0xff, 0xff, 0xff), RGBA(0xff, 0xff, 0xff, 0xff));
|
||||
screenLCD->RefreshRows(0, 2); //SwapBuffers();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (emulating)
|
||||
|
|
Loading…
Reference in a new issue