Skip to content

Commit 849c97c

Browse files
committed
make timeout counter volatile
1 parent a9929dc commit 849c97c

File tree

1 file changed

+1
-1
lines changed
  • libraries/Wire/src/utility

1 file changed

+1
-1
lines changed

Diff for: libraries/Wire/src/utility/twi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ 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-
uint32_t counter = 0;
407+
volatile uint32_t counter = 0;
408408
while(TWCR & _BV(TWSTO)){
409409
counter++;
410410
if((twi_timeout_us > 0ul) && (counter >= 25000)) {

0 commit comments

Comments
 (0)