File tree 1 file changed +2
-2
lines changed
hardware/arduino/avr/libraries/Wire/utility
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -476,6 +476,8 @@ ISR(TWI_vect)
476
476
}
477
477
break ;
478
478
case TW_SR_STOP : // stop or repeated start condition received
479
+ // ack future responses and leave slave receiver state
480
+ twi_releaseBus ();
479
481
// put a null char after data if there's room
480
482
if (twi_rxBufferIndex < TWI_BUFFER_LENGTH ){
481
483
twi_rxBuffer [twi_rxBufferIndex ] = '\0' ;
@@ -484,8 +486,6 @@ ISR(TWI_vect)
484
486
twi_onSlaveReceive (twi_rxBuffer , twi_rxBufferIndex );
485
487
// since we submit rx buffer to "wire" library, we can reset it
486
488
twi_rxBufferIndex = 0 ;
487
- // ack future responses and leave slave receiver state
488
- twi_releaseBus ();
489
489
break ;
490
490
case TW_SR_DATA_NACK : // data received, returned nack
491
491
case TW_SR_GCALL_DATA_NACK : // data received generally, returned nack
You can’t perform that action at this time.
0 commit comments