From f8db28186908761a49b0f14c6e3bd410558e52a0 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Fri, 7 Feb 2020 22:57:06 +0100 Subject: [PATCH] OLED display reset now by oledInit() --- src/display.cpp | 14 ++------------ src/ota.cpp | 6 ++---- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/display.cpp b/src/display.cpp index 95bf30a2..9c986f99 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -68,21 +68,11 @@ void init_display(bool verbose) { ESP_LOGV(TAG, "[%0.3f] i2c mutex lock failed", millis() / 1000.0); else { - // is we have display RST line we toggle it to re-initialize display -#ifdef MY_OLED_RST - pinMode(MY_OLED_RST, OUTPUT); - digitalWrite(MY_OLED_RST, 0); // initialization of SSD1306 chip is executed - delay(1); // keep RES low for at least 3us according to SSD1306 datasheet - digitalWrite(MY_OLED_RST, 1); // normal operation -#endif - // init display #ifndef DISPLAY_FLIP - oledInit(OLED_128x64, false, false, -1, -1, - MY_OLED_RST == NOT_A_PIN ? -1 : MY_OLED_RST, 400000L); + oledInit(OLED_128x64, false, false, -1, -1, MY_OLED_RST, 400000L); #else - oledInit(OLED_128x64, true, false, -1, -1, - MY_OLED_RST == NOT_A_PIN ? -1 : MY_OLED_RST, 400000L); + oledInit(OLED_128x64, true, false, -1, -1, MY_OLED_RST, 400000L); #endif // set display buffer diff --git a/src/ota.cpp b/src/ota.cpp index a9fa8ba2..fb2161ee 100644 --- a/src/ota.cpp +++ b/src/ota.cpp @@ -46,11 +46,9 @@ void start_ota_update() { #ifdef HAS_DISPLAY #ifndef DISPLAY_FLIP - oledInit(OLED_128x64, false, false, -1, -1, - MY_OLED_RST == NOT_A_PIN ? -1 : MY_OLED_RST, 400000L); + oledInit(OLED_128x64, false, false, -1, -1, MY_OLED_RST, 400000L); #else - oledInit(OLED_128x64, true, false, -1, -1, - MY_OLED_RST == NOT_A_PIN ? -1 : MY_OLED_RST, 400000L); + oledInit(OLED_128x64, true, false, -1, -1, MY_OLED_RST, 400000L); #endif // set display buffer