8000 i2c_clock_stretching_fix by suculent · Pull Request #5362 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

i2c_clock_stretching_fix #5362

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

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
i2c_clock_stretching_fix
  • Loading branch information
Matěj Sychra committed Nov 21, 2018
commit 474ba24ce86f12d560db02a5dfd27977cde83209
2 changes: 2 additions & 0 deletions cores/esp8266/core_esp8266_si2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ unsigned char twi_writeTo(unsigned char address, unsigned char * buf, unsigned i
SCL_LOW();
twi_delay(twi_dcount);
SCL_HIGH();
unsigned int t=0; while(SCL_READ()==0 && (t++)<twi_clockStretchLimit); // twi_clockStretchLimit
twi_delay(twi_dcount);
}
return 0;
Expand All @@ -287,6 +288,7 @@ unsigned char twi_readFrom(unsigned char address, unsigned char* buf, unsigned i
SCL_LOW();
twi_delay(twi_dcount);
SCL_HIGH();
unsigned int t=0; while(SCL_READ()==0 && (t++)<twi_clockStretchLimit); // Clock stretching
twi_delay(twi_dcount);
}
return 0;
Expand Down
0