From cdd293cceaaf88ca5884593242d9e2700515e639 Mon Sep 17 00:00:00 2001 From: MCUdude Date: Sat, 21 Jan 2023 15:47:45 +0100 Subject: [PATCH] Reduce delay It mow matches the ArduinoCore-avr implementation --- avr/libraries/Wire/src/utility/twi.c | 2 +- avr/libraries/Wire1/src/utility/twi1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/avr/libraries/Wire/src/utility/twi.c b/avr/libraries/Wire/src/utility/twi.c index 1e4b7916..0473ce3b 100755 --- a/avr/libraries/Wire/src/utility/twi.c +++ b/avr/libraries/Wire/src/utility/twi.c @@ -444,7 +444,7 @@ void twi_stop(void) while(TWCR & _BV(TWSTO)){ if(twi_timeout_us > 0ul){ if (counter > 0ul){ - _delay_us(10); + _delay_us(us_per_loop); counter--; } else { twi_handleTimeout(twi_do_reset_on_timeout); diff --git a/avr/libraries/Wire1/src/utility/twi1.c b/avr/libraries/Wire1/src/utility/twi1.c index 13a0aa2c..7f4bf677 100755 --- a/avr/libraries/Wire1/src/utility/twi1.c +++ b/avr/libraries/Wire1/src/utility/twi1.c @@ -444,7 +444,7 @@ void twi_stop1(void) while(TWCR1 & _BV(TWSTO)){ if(twi_timeout_us > 0ul){ if (counter > 0ul){ - _delay_us(10); + _delay_us(us_per_loop); counter--; } else { twi_handleTimeout1(twi_do_reset_on_timeout);