Skip to content

Commit dd34343

Browse files
committed
Fix indentation
1 parent 4040473 commit dd34343

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

libraries/Wire/src/Wire.cpp

+12-12
Original file line numberDiff line numberDiff line change
@@ -94,21 +94,21 @@ void TwoWire::setTimeoutInMillis(uint8_t timeout)
9494
uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint32_t iaddress, uint8_t isize, uint8_t sendStop)
9595
{
9696
if (isize > 0) {
97-
// send internal address; this mode allows sending a repeated start to access
98-
// some devices' internal registers. This function is executed by the hardware
99-
// TWI module on other processors (for example Due's TWI_IADR and TWI_MMR registers)
97+
// send internal address; this mode allows sending a repeated start to access
98+
// some devices' internal registers. This function is executed by the hardware
99+
// TWI module on other processors (for example Due's TWI_IADR and TWI_MMR registers)
100100

101-
beginTransmission(address);
101+
beginTransmission(address);
102102

103-
// the maximum size of internal address is 3 bytes
104-
if (isize > 3){
105-
isize = 3;
106-
}
103+
// the maximum size of internal address is 3 bytes
104+
if (isize > 3){
105+
isize = 3;
106+
}
107107

108-
// write internal register address - most significant byte first
109-
while (isize-- > 0)
110-
write((uint8_t)(iaddress >> (isize*8)));
111-
endTransmission(false);
108+
// write internal register address - most significant byte first
109+
while (isize-- > 0)
110+
write((uint8_t)(iaddress >> (isize*8)));
111+
endTransmission(false);
112112
}
113113

114114
// clamp to buffer length

libraries/Wire/src/utility/twi.c

+21-21
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ void twi_reply(uint8_t ack)
390390
if(ack){
391391
TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT) | _BV(TWEA);
392392
}else{
393-
TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT);
393+
TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT);
394394
}
395395
}
396396

@@ -434,7 +434,7 @@ void twi_releaseBus(void)
434434

435435
void twi_setTimeoutInMillis(uint8_t timeout)
436436
{
437-
twi_timeout_ms = timeout;
437+
twi_timeout_ms = timeout;
438438
}
439439

440440
ISR(TWI_vect)
@@ -457,16 +457,16 @@ ISR(TWI_vect)
457457
TWDR = twi_masterBuffer[twi_masterBufferIndex++];
458458
twi_reply(1);
459459
}else{
460-
if (twi_sendStop)
460+
if (twi_sendStop)
461461
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+
}
470470
}
471471
break;
472472
case TW_MT_SLA_NACK: // address sent, nack received
@@ -497,17 +497,17 @@ ISR(TWI_vect)
497497
case TW_MR_DATA_NACK: // data received, nack sent
498498
// put final byte into buffer
499499
twi_masterBuffer[twi_masterBufferIndex++] = TWDR;
500-
if (twi_sendStop)
500+
if (twi_sendStop)
501501
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;
511511
case TW_MR_SLA_NACK: // address sent, nack received
512512
twi_stop();
513513
break;

0 commit comments

Comments
 (0)