swap pages for SSD1306 128x32 displays

This commit is contained in:
penfold42 2018-07-26 12:19:35 +10:00
parent ee175ec1fd
commit 78e20ae4bb

View file

@ -154,6 +154,13 @@ void SSD1306::RefreshRows(u32 start, u32 amountOfRows)
void SSD1306::RefreshPage(u32 page) void SSD1306::RefreshPage(u32 page)
{ {
// x32 displays use lower half (pages 2 and 3)
if (type == LCD_1306_128x32)
{
page = page+2; // 0,1 -> 2,3
page = page%4; // and wrap it so 2,3 -> 0,1
}
int i; int i;
int start = page*128; int start = page*128;
int end = page*128 + 128; int end = page*128 + 128;