From 63cfe0fdd8439187f6867f8a3f6deaa4348c4c58 Mon Sep 17 00:00:00 2001 From: Alnef <81906646+Alnef@users.noreply.github.com> Date: Sat, 10 Apr 2021 14:59:11 +0200 Subject: [PATCH] Fix contrast and display mode initialisation The double byte command OLED_CMD_SET_CONTRAST (SSD1306 datasheet rev 1.1 p.28) was followed by display_mode. So the contrast was set to 0xA6 or 0xA7 depending on the display mode configured and the display mode itself wasn't configurable. --- lvgl_tft/ssd1306.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lvgl_tft/ssd1306.c b/lvgl_tft/ssd1306.c index be35be6..43e5966 100644 --- a/lvgl_tft/ssd1306.c +++ b/lvgl_tft/ssd1306.c @@ -126,8 +126,8 @@ void ssd1306_init(void) orientation_1, orientation_2, OLED_CMD_SET_CONTRAST, - display_mode, 0xFF, + display_mode, OLED_CMD_DISPLAY_ON };