Skip to content

Commit 3e66648

Browse files
committed
Force full redraw on rotate
1 parent 1ac00c5 commit 3e66648

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/Core/Drivers/OLED.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,17 @@ void OLED::setRotation(bool leftHanded) {
361361
OLED_Setup_Array[9].val = 0xA0;
362362
}
363363
I2C_CLASS::writeRegistersBulk(DEVICEADDR_OLED, OLED_Setup_Array, sizeof(OLED_Setup_Array) / sizeof(OLED_Setup_Array[0]));
364-
364+
osDelay(TICKS_10MS);
365365
inLeftHandedMode = leftHanded;
366366

367367
screenBuffer[5] = inLeftHandedMode ? 0 : 32; // display is shifted by 32 in left handed
368368
// mode as driver ram is 128 wide
369369
screenBuffer[7] = inLeftHandedMode ? 95 : 0x7F; // End address of the ram segment we are writing to (96 wide)
370370
screenBuffer[9] = inLeftHandedMode ? 0xC8 : 0xC0;
371+
//Force a screen refresh
372+
const int len = FRAMEBUFFER_START + (OLED_WIDTH * 2);
373+
I2C_CLASS::Transmit(DEVICEADDR_OLED, screenBuffer, len);
374+
osDelay(TICKS_10MS);
371375
}
372376

373377
void OLED::setBrightness(uint8_t contrast) {

0 commit comments

Comments
 (0)