BV OLED: fix drawing

This commit is contained in:
King Kévin 2018-02-06 12:28:26 +01:00
parent b1ce81eeda
commit 6111f30f4e
1 changed files with 4 additions and 3 deletions

View File

@ -340,7 +340,6 @@ void busvoodoo_oled_setup(void)
if (busvoodoo_oled_present) {
oled_ssd1306_test(); // test OLED display
busvoodoo_oled_update(); // send display buffer
oled_ssd1306_on(); // switch display on
};
}
@ -365,7 +364,7 @@ void busvoodoo_oled_text_left(char* text)
}
uint8_t column = 1; // on which column to draw
while (text && column<128) { // draw until end or text or screen
while (*text && column<128) { // draw until end or text or screen
char c = ' '; // default character to draw
if (*text>' ' && *text<' '+LENGTH(font_king14)) { // we have a glyph for this character
c = *text;
@ -405,7 +404,7 @@ void busvoodoo_oled_text_right(char* text)
void busvoodoo_oled_text_pinout(const char* pins[10], bool io_connector)
{
// clear bottom (blue) display part
for (uint16_t i=128*3; i<LENGTH(busvoodoo_oled_display); i++) {
for (uint16_t i=128*2; i<LENGTH(busvoodoo_oled_display); i++) {
busvoodoo_oled_display[i] = 0;
}
@ -587,6 +586,8 @@ void busvoodoo_oled_text_pinout(const char* pins[10], bool io_connector)
void busvoodoo_oled_update(void)
{
if (busvoodoo_oled_present) { // only do something if the display is present
oled_ssd1306_off(); // switch display off to not see the update
oled_ssd1306_display(busvoodoo_oled_display, LENGTH(busvoodoo_oled_display)); // send current display buffer
oled_ssd1306_on(); // switch display back on
}
}