From d15969bd1ed855035e1cb462d7c80c4749039dfa Mon Sep 17 00:00:00 2001 From: Jan Penninkhof Date: Fri, 3 Jan 2020 10:07:42 +0100 Subject: [PATCH] Reset before initialisation of the SSD1306 when OLED reset pin is set If an OLED Reset pin has been selected using the PIN configuration, it makes sense to also send a reset signal to this pin before initialization of the display. The current value 0 doesn't send this signal, not even when a reset pin has been selected. Hence the change of value 0 into reset_pin >= 0. If no reset pin was set, the value of this variable is -1. --- tasmota/xdsp_02_ssd1306.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xdsp_02_ssd1306.ino b/tasmota/xdsp_02_ssd1306.ino index 8cf938c6c..6060686b9 100644 --- a/tasmota/xdsp_02_ssd1306.ino +++ b/tasmota/xdsp_02_ssd1306.ino @@ -83,7 +83,7 @@ void SSD1306InitDriver(void) // init renderer // oled1306 = new Adafruit_SSD1306(SSD1306_LCDWIDTH,SSD1306_LCDHEIGHT); oled1306 = new Adafruit_SSD1306(Settings.display_width, Settings.display_height, &Wire, reset_pin); - oled1306->begin(SSD1306_SWITCHCAPVCC, Settings.display_address[0], 0); + oled1306->begin(SSD1306_SWITCHCAPVCC, Settings.display_address[0], reset_pin >= 0); renderer = oled1306; renderer->DisplayInit(DISPLAY_INIT_MODE, Settings.display_size, Settings.display_rotate, Settings.display_font); renderer->setTextColor(1,0);