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.
This commit is contained in:
Jan Penninkhof 2020-01-03 10:07:42 +01:00 committed by GitHub
parent 894950ca4e
commit d15969bd1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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);