From 3cd8bc2545145bbe07eddbffa214a7f57c309eb3 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 30 Oct 2019 10:14:16 +0100 Subject: [PATCH] Add SSD1306 64x48 pixel support Add SSD1306 64x48 pixel support (#6740) --- lib/Adafruit_SSD1306-1.3.0-gemu-1.1/Adafruit_SSD1306.cpp | 7 +++++++ tasmota/xdsp_02_ssd1306.ino | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Adafruit_SSD1306-1.3.0-gemu-1.1/Adafruit_SSD1306.cpp b/lib/Adafruit_SSD1306-1.3.0-gemu-1.1/Adafruit_SSD1306.cpp index 9015c6e83..9827f7584 100644 --- a/lib/Adafruit_SSD1306-1.3.0-gemu-1.1/Adafruit_SSD1306.cpp +++ b/lib/Adafruit_SSD1306-1.3.0-gemu-1.1/Adafruit_SSD1306.cpp @@ -563,6 +563,13 @@ boolean Adafruit_SSD1306::begin(uint8_t vcs, uint8_t addr, boolean reset, SSD1306_SETCONTRAST }; // 0x81 ssd1306_commandList(init4c, sizeof(init4c)); ssd1306_command1((vccstate == SSD1306_EXTERNALVCC) ? 0x10 : 0xAF); + } else if((WIDTH == 64) && (HEIGHT == 48)) { + static const uint8_t PROGMEM init4d[] = { + SSD1306_SETCOMPINS, // 0xDA + 0x12, + SSD1306_SETCONTRAST }; // 0x81 + ssd1306_commandList(init4d, sizeof(init4d)); + ssd1306_command1((vccstate == SSD1306_EXTERNALVCC) ? 0x9F : 0xCF); } else { // Other screen varieties -- TBD } diff --git a/tasmota/xdsp_02_ssd1306.ino b/tasmota/xdsp_02_ssd1306.ino index 4b49c2329..060d54fa1 100644 --- a/tasmota/xdsp_02_ssd1306.ino +++ b/tasmota/xdsp_02_ssd1306.ino @@ -61,10 +61,10 @@ void SSD1306InitDriver() if (XDSP_02 == Settings.display_model) { - if ((Settings.display_width != 96) && (Settings.display_width != 128)) { + if ((Settings.display_width != 64) && (Settings.display_width != 96) && (Settings.display_width != 128)) { Settings.display_width = 128; } - if ((Settings.display_height != 16) && (Settings.display_height != 32) && (Settings.display_height != 64)) { + if ((Settings.display_height != 16) && (Settings.display_height != 32) && (Settings.display_height != 48) && (Settings.display_height != 64)) { Settings.display_height = 64; }