Skip to content

Commit

Permalink
Force delay after display state change
Browse files Browse the repository at this point in the history
So that we backoff if OLED is busy
  • Loading branch information
Ralim committed Nov 6, 2022
1 parent 7eb9f3f commit 9deaa26
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/Core/Drivers/OLED.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ class OLED {
}

static void setDisplayState(DisplayState state) {
displayState = state;
screenBuffer[1] = (state == ON) ? 0xAF : 0xAE;
if (state != displayState) {
displayState = state;
screenBuffer[1] = (state == ON) ? 0xAF : 0xAE;
// Dump the screen state change out _now_
I2C_CLASS::Transmit(DEVICEADDR_OLED, screenBuffer, FRAMEBUFFER_START - 1);
osDelay(TICKS_10MS);
}
}

static void setRotation(bool leftHanded); // Set the rotation for the screen
Expand Down

0 comments on commit 9deaa26

Please sign in to comment.