adafruit / Adafruit-ST7735-Library

This is a library for the Adafruit 1.8" SPI display http://www.adafruit.com/products/358 and http://www.adafruit.com/products/618
https://learn.adafruit.com/1-8-tft-display
547 stars 303 forks source link

For the 135x240 display, the offset was incorrect by 1 pixel #161

Closed kevinfrei closed 2 years ago

kevinfrei commented 2 years ago

This change only modifies the offsets for rendering on the 1.13" 135x240 LCD (https://www.adafruit.com/product/4383)

Prior to this change, if you did this: tft.fillScreen(ST77XX_WHITE); tft.setRotatation(1); tft.fillScreen(ST77XX_BLACK);

you would wind up with the top line (where 'top' is the row of pixels closest to the solder holes) being white. It just looks like the offset was off by one, thanks to an odd width value.

Please let me know if there's any specific testing/validation you want. I'm running this on a Teensy 4.0 at 600MHz, with an SPI clock set to 60MHz. I've validated the issue is consistent across much slower clock frequencies for both the MPU and the SPI bus.

makermelissa commented 2 years ago

Please test that this works in all rotations. This particular display has a centered rectangle inside a larger 320x240 memory buffer allowing for an offset of 52 on one side and 53 on the other (due to the odd 135 width), which is affected by different rotations.

kevinfrei commented 2 years ago

Will do! I'll report back when I've validated it (or changed the PR :) )

kevinfrei commented 2 years ago

Good call. I made a test that demonstrates the problem (both for the baseline, and it demonstrates that my PR doesn't quite fix it properly). I'll fix it and put up a new PR when it's fixed (with a link to the test, as well :) )