We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36821cf commit a9929dcCopy full SHA for a9929dc
libraries/Wire/src/utility/twi.c
@@ -404,9 +404,10 @@ void twi_stop(void)
404
405
// wait for stop condition to be exectued on bus
406
// TWINT is not set after a stop condition!
407
- unit32_t startMicros = micros();
+ uint32_t counter = 0;
408
while(TWCR & _BV(TWSTO)){
409
- if((twi_timeout_us > 0ul) && (micros() - startMicros > twi_timeout_us)) {
+ counter++;
410
+ if((twi_timeout_us > 0ul) && (counter >= 25000)) {
411
twi_handleTimeout();
412
return;
413
}
0 commit comments