ArmDeveloperEcosystem / st7789-library-for-pico

Use an ST7789 based TFT LCD display with your Raspberry Pi Pico or any RP2040 based board 📺
Apache License 2.0
67 stars 8 forks source link

CASET/RASET max value issue #3

Open benheck opened 1 year ago

benheck commented 1 year ago

I noticed this when comparing this ARM code to ST7789 code I wrote for an Atmel last year. (for the ST7789 240x240)

CASET/RASET sets the address window by coordinates. For a 240x240, this should be 0,0, 239, 239.

I fixed the issue by subtracting 1 from the CASET/RASET calls.

void st7789_set_cursor(uint16_t x, uint16_t y) { st7789_caset(x, st7789_width - 1); st7789_raset(y, st7789_height - 1); }

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

sandeepmistry commented 1 year ago

hi @benheck,

Thank you for bringing this up, do you have time to make a pull request for this change and provide a code snippet to validate the behaviour before and after the change.