Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/OLEDDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ OLEDDisplay::OLEDDisplay() {

displayWidth = 128;
displayHeight = 64;
displayBufferSize = displayWidth * displayHeight / 8;
maxDisplayHeight = ((displayHeight + 7) / 8) * 8;
displayBufferSize = displayWidth * maxDisplayHeight / 8;
color = WHITE;
geometry = GEOMETRY_128_64;
textAlignment = TEXT_ALIGN_LEFT;
Expand Down Expand Up @@ -1001,7 +1002,8 @@ void OLEDDisplay::setGeometry(OLEDDISPLAY_GEOMETRY g, uint16_t width, uint16_t h
this->displayHeight = height > 0 ? height : 64;
break;
}
this->displayBufferSize = displayWidth * displayHeight / 8;
maxDisplayHeight = ((displayHeight + 7) / 8) * 8;
this->displayBufferSize = displayWidth * maxDisplayHeight / 8;
}

void OLEDDisplay::sendInitCommands(void) {
Expand Down
1 change: 1 addition & 0 deletions src/OLEDDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ class OLEDDisplay : public Stream {

uint16_t displayWidth;
uint16_t displayHeight;
uint16_t maxDisplayHeight;
uint16_t displayBufferSize;

OLEDDISPLAY_TEXT_ALIGNMENT textAlignment;
Expand Down
Loading