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

Misplaced delays #6

Open
Bornock opened this issue Apr 29, 2021 · 1 comment
Open

Misplaced delays #6

Bornock opened this issue Apr 29, 2021 · 1 comment

Comments

@Bornock
Copy link

Bornock commented Apr 29, 2021

In the two routines
void GSL1680::clear_reg() and void GSL1680::reset()
the < delay(TIMER[i]); > should be placed outside of the for...loop after the < int r = Wire.endTransmission(); >

With the delay inside the loop it introduces extra delays onto the I2C bus timings that cause unwanted errors 3 or 4. The GSL1680 uses these delays to actually execute the clear and/or reset.

@Skallwar
Copy link
Owner

As far as I can understand, the linux kernel seem to do the same as I am currently doing: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/input/touchscreen/silead.c#n244

Maybe I did not understand what you are saying. Feel free to open a PR, so we can discus this over some code ;)

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

No branches or pull requests

2 participants