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

twi_status clockCount wrong usage ?? #4063

Closed
miky2k opened this issue Jan 1, 2018 · 4 comments
Closed

twi_status clockCount wrong usage ?? #4063

miky2k opened this issue Jan 1, 2018 · 4 comments
Assignees
Milestone

Comments

@miky2k
Copy link

miky2k commented Jan 1, 2018

while (SDA_READ()==0 && clockCount>0){

should be

while (SDA_READ()==0 && clockCount-->0){

i feel that clockCount should be 10 not 20 (eight bit + ack + stop)

@devyte
Copy link
Collaborator

devyte commented Jan 8, 2018

@miky2k When you opened the issue, you were presented with an issue template requesting specific information. You have completely ignored that. Please edit your post and add the required info.
Also, can you please explain better what you mean?

@devyte devyte added the waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. label Jan 8, 2018
@miky2k
Copy link
Author

miky2k commented Jan 8, 2018

clockCount is initialized , tested , but never changed (so why test it?),
I'm sure that, if this is true , the board,the compiler and other stuff are irrelevant, it's only c/c++ programming issue.

twi_status is helpful to unlock i2c after random reset if stolen by slave for what i understand.

@5chufti
Copy link
Contributor

5chufti commented Jan 9, 2018

maybe devs would be more willing to looking into this if you'd provide more reference like e.g. filename and line number ?

@devyte
Copy link
Collaborator

devyte commented Jan 10, 2018

After investigating the universe, I managed to descipher that:

  • this issue refers to I2C here
  • the comment does seem to make sense: clockCount seems to be some kind of timeout, and in that case decrementing it is likely correct
  • There is a relevant PR: Update core_esp8266_si2c.c #4070

The question that remains is whether clock_count should start at 20 like now (the PR doesn't change this value), or at 10 as proposed here.

@devyte devyte added type: bug component: core and removed waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. labels Jan 10, 2018
@devyte devyte added this to the 2.5.0 milestone Jan 10, 2018
@devyte devyte self-assigned this Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants