@@ -390,7 +390,7 @@ void twi_reply(uint8_t ack)
390
390
if (ack ){
391
391
TWCR = _BV (TWEN ) | _BV (TWIE ) | _BV (TWINT ) | _BV (TWEA );
392
392
}else {
393
- TWCR = _BV (TWEN ) | _BV (TWIE ) | _BV (TWINT );
393
+ TWCR = _BV (TWEN ) | _BV (TWIE ) | _BV (TWINT );
394
394
}
395
395
}
396
396
@@ -434,7 +434,7 @@ void twi_releaseBus(void)
434
434
435
435
void twi_setTimeoutInMillis (uint8_t timeout )
436
436
{
437
- twi_timeout_ms = timeout ;
437
+ twi_timeout_ms = timeout ;
438
438
}
439
439
440
440
ISR (TWI_vect )
@@ -457,16 +457,16 @@ ISR(TWI_vect)
457
457
TWDR = twi_masterBuffer [twi_masterBufferIndex ++ ];
458
458
twi_reply (1 );
459
459
}else {
460
- if (twi_sendStop )
460
+ if (twi_sendStop )
461
461
twi_stop ();
462
- else {
463
- twi_inRepStart = true; // we're gonna send the START
464
- // don't enable the interrupt. We'll generate the start, but we
465
- // avoid handling the interrupt until we're in the next transaction,
466
- // at the point where we would normally issue the start.
467
- TWCR = _BV (TWINT ) | _BV (TWSTA )| _BV (TWEN ) ;
468
- twi_state = TWI_READY ;
469
- }
462
+ else {
463
+ twi_inRepStart = true; // we're gonna send the START
464
+ // don't enable the interrupt. We'll generate the start, but we
465
+ // avoid handling the interrupt until we're in the next transaction,
466
+ // at the point where we would normally issue the start.
467
+ TWCR = _BV (TWINT ) | _BV (TWSTA )| _BV (TWEN ) ;
468
+ twi_state = TWI_READY ;
469
+ }
470
470
}
471
471
break ;
472
472
case TW_MT_SLA_NACK : // address sent, nack received
@@ -497,17 +497,17 @@ ISR(TWI_vect)
497
497
case TW_MR_DATA_NACK : // data received, nack sent
498
498
// put final byte into buffer
499
499
twi_masterBuffer [twi_masterBufferIndex ++ ] = TWDR ;
500
- if (twi_sendStop )
500
+ if (twi_sendStop )
501
501
twi_stop ();
502
- else {
503
- twi_inRepStart = true; // we're gonna send the START
504
- // don't enable the interrupt. We'll generate the start, but we
505
- // avoid handling the interrupt until we're in the next transaction,
506
- // at the point where we would normally issue the start.
507
- TWCR = _BV (TWINT ) | _BV (TWSTA )| _BV (TWEN ) ;
508
- twi_state = TWI_READY ;
509
- }
510
- break ;
502
+ else {
503
+ twi_inRepStart = true; // we're gonna send the START
504
+ // don't enable the interrupt. We'll generate the start, but we
505
+ // avoid handling the interrupt until we're in the next transaction,
506
+ // at the point where we would normally issue the start.
507
+ TWCR = _BV (TWINT ) | _BV (TWSTA )| _BV (TWEN ) ;
508
+ twi_state = TWI_READY ;
509
+ }
510
+ break ;
511
511
case TW_MR_SLA_NACK : // address sent, nack received
512
512
twi_stop ();
513
513
break ;
0 commit comments