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 6127423 commit bc0e699Copy full SHA for bc0e699
libraries/Wire/src/utility/twi.c
@@ -443,8 +443,19 @@ void twi_setTimeoutInMicros(uint16_t timeout)
443
*/
444
void twi_handleTimeout(void)
445
{
446
+ // remember the bitrate register value
447
+ uint8_t previous_TWBR = TWBR;
448
+
449
+ // remember the address register value
450
+ uint8_t previous_TWAR = TWBR;
451
452
+ // reset the interface
453
twi_disable();
454
twi_init();
455
456
+ // reapply the previous register values
457
+ TWAR = previous_TWAR;
458
+ TWBR = previous_TWAR;
459
}
460
461
ISR(TWI_vect)
0 commit comments