Merge pull request #11822 from gemu2015/mdisp

fixes for multidisplay
This commit is contained in:
Theo Arends 2021-04-21 12:42:34 +02:00 committed by GitHub
commit b082852196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

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

View File

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

View File

@ -36,7 +36,7 @@
#include <SPI.h>
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;