Skip to content

Commit a9929dc

Browse files
committed
Revert "twi_stop() should use the same timeout as everywhere else"
This reverts commit 68fe5f1.
1 parent 36821cf commit a9929dc

File tree

1 file changed

+3
-2
lines changed
  • libraries/Wire/src/utility

1 file changed

+3
-2
lines changed

libraries/Wire/src/utility/twi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,10 @@ void twi_stop(void)
404404

405405
// wait for stop condition to be exectued on bus
406406
// TWINT is not set after a stop condition!
407-
unit32_t startMicros = micros();
407+
uint32_t counter = 0;
408408
while(TWCR & _BV(TWSTO)){
409-
if((twi_timeout_us > 0ul) && (micros() - startMicros > twi_timeout_us)) {
409+
counter++;
410+
if((twi_timeout_us > 0ul) && (counter >= 25000)) {
410411
twi_handleTimeout();
411412
return;
412413
}

0 commit comments

Comments
 (0)