Delay I2C DMA thread on oled slightly

The flickering on the LCD screen was caused by the OLED DMA taking slightly longer than the delays, so the tail end would flicker if the buffer was cleared before it finished writing.

In future may want to double buffer the LCD.

Fixes #290
This commit is contained in:
Ben V. Brown
2018-05-11 12:54:55 +10:00
parent 8bf65351ea
commit b6b207568c
3 changed files with 17 additions and 12 deletions

View File

@@ -35,6 +35,8 @@ public:
// Draw the buffer out to the LCD using the DMA Channel
void refresh() {
i2c->Transmit( DEVICEADDR_OLED, screenBuffer, FRAMEBUFFER_START + (OLED_WIDTH * 2));
//DMA tx time is ~ 20mS Ensure after calling this you delay for at least 25ms
//or we need to goto double buffering
}
void drawChar(char c, char preCursorCommand = '\0'); // Draw a character to a specific location