Closed ygator closed 3 years ago
I did this in readPixel and everything works. The other functions that use the define are setWindow, readAddrWindow, drawPixel, and getSetup. drawPixel works fine as it is.
x0+=colstart; y0+=rowstart;
Looking more into readPixel I see it does:
x0+=colstart; y0+=rowstart;
but later calls readAddrWindow which does:
xs += colstart; xe += colstart; ys += rowstart; ye += rowstart;
So it looks like it is adding the offsets twice. So the offsets are not needed in readPixel at all.
Fixed, thanks for reporting this.
With CGRAM_OFFSET defined readPixel is off 52,40 and display is correct, but if not defined readPixel is correct and display is off 52,40.
Platformio TFT_eSPI version 2.3.41 build_flags = -DTFT_SDA_READ -DUSER_SETUP_LOADED -DST7789_DRIVER -DTFT_WIDTH=135 -DTFT_HEIGHT=240 -DCGRAM_OFFSET -DTFT_MISO=-1 -DTFT_MOSI=19 -DTFT_SCLK=18 -DTFT_CS=5 -DTFT_DC=16 -DTFT_RST=23 -DTFT_BL=4 -DTFT_BACKLIGHT_ON=HIGH -DLOAD_GLCD -DLOAD_FONT2 -DLOAD_FONT4 -DLOAD_FONT6 -DLOAD_FONT7 -DLOAD_FONT8 -DLOAD_GFXFF -DSMOOTH_FONT -DSPI_FREQUENCY=40000000 -DSPI_READ_FREQUENCY=6000000