Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overflow #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix overflow #8

wants to merge 1 commit into from

Conversation

SeanDS
Copy link

@SeanDS SeanDS commented Apr 26, 2019

I had a weird issue with my TJCTM24028-SPI (cheap eBay touch screen + TFT) and this library. When touching the lower 25% of the screen, the XPTPaint program worked ok, but when going into the top 75% the lines jumped off the screen and were not where my finger was touching. I tracked down the cause (or, at least, the change that fixes this) to the calibration variables _cal_vi1 and _cal_vj1. These were previously set to uint16_t, but are used in a calibration operation involving int32_t numbers, potentially leading to overflow (as in my case). Changing these variables to int32_t fixes this overflow, and solves the problem on my screen with discontinuities.

The calibration variables _cal_vi1 and _cal_vj1 were uint16_t, but this led to overflow on my screen, making the
touch x-position jump from around 100 to 56,000 in the lower 25% of the screen. Changing these variables to int32_t
fixes this overflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant