From 02cab3cad0506933ae71f259c740e2dfb2c6a943 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Wed, 21 Apr 2021 12:02:46 +0200 Subject: [PATCH 1/2] fixes --- lib/libesp32_epdiy/src/epd4in7.cpp | 8 ++++---- tasmota/xdsp_04_ili9341.ino | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/libesp32_epdiy/src/epd4in7.cpp b/lib/libesp32_epdiy/src/epd4in7.cpp index 4f041b473..9f0e44e86 100644 --- a/lib/libesp32_epdiy/src/epd4in7.cpp +++ b/lib/libesp32_epdiy/src/epd4in7.cpp @@ -42,7 +42,7 @@ #define WAVEFORM EPD_BUILTIN_WAVEFORM -extern uint8_t *buffer; +uint8_t *epd47_buffer; int temperature = 25; @@ -60,7 +60,7 @@ Epd47::Epd47(int16_t dwidth, int16_t dheight) : Renderer(dwidth, dheight) { int32_t Epd47::Init(void) { epd_init(EPD_LUT_1K); hl = epd_hl_init(WAVEFORM); - buffer = epd_hl_get_framebuffer(&hl); + epd47_buffer = epd_hl_get_framebuffer(&hl); return 0; } @@ -106,7 +106,7 @@ void Epd47::Updateframe() { void Epd47::fillScreen(uint16_t color) { color &= 0xf; uint8_t icol = (color << 4) | color; - memset(buffer, icol, width * height / 2); + memset(epd47_buffer, icol, width * height / 2); } #define _swap(a, b) { uint16_t t = a; a = b; b = t; } @@ -134,7 +134,7 @@ uint8_t *buf_ptr; if (xp >= width) return; if (yp >= height) return; - buf_ptr = &buffer[yp * width / 2 + xp / 2]; + buf_ptr = &epd47_buffer[yp * width / 2 + xp / 2]; if (xp % 2) { *buf_ptr = (*buf_ptr & 0x0F) | (color << 4); diff --git a/tasmota/xdsp_04_ili9341.ino b/tasmota/xdsp_04_ili9341.ino index 5401855dd..73d6c183e 100644 --- a/tasmota/xdsp_04_ili9341.ino +++ b/tasmota/xdsp_04_ili9341.ino @@ -217,12 +217,16 @@ ili9342_ctouch_counter++; if (2 == ili9342_ctouch_counter) { // every 100 ms should be enough ili9342_ctouch_counter = 0; +#ifdef USE_FT5206 if (FT5206_found) { Touch_Check(FT5206_TS_RotConvert); } +#endif // USE_FT5206 +#ifdef USE_XPT2046 if (XPT2046_found) { Touch_Check(XPT2046_TS_RotConvert); } +#endif // USE_XPT2046 } } #endif // USE_TOUCH_BUTTONS From 614280ad69bd3a1b48b3809c550f2523fc03a8f8 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Wed, 21 Apr 2021 12:19:09 +0200 Subject: [PATCH 2/2] Update xdsp_14_SSD1331.ino --- tasmota/xdsp_14_SSD1331.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasmota/xdsp_14_SSD1331.ino b/tasmota/xdsp_14_SSD1331.ino index 3cfa436c9..e9a7f7a35 100644 --- a/tasmota/xdsp_14_SSD1331.ino +++ b/tasmota/xdsp_14_SSD1331.ino @@ -36,7 +36,7 @@ #include bool ssd1331_init_done = false; -extern uint8_t *buffer; + extern uint8_t color_type; Adafruit_SSD1331 *ssd1331; @@ -55,7 +55,6 @@ void SSD1331_InitDriver() { Settings.display_height = Adafruit_SSD1331::TFTHEIGHT; } - buffer = 0; // default colors fg_color = SSD1331_WHITE;