Skip to content

Commit 786e405

Browse files
authored
Merge pull request #100 from CombiesGit/patch-1
[TWI] Add __attribute__ ((fallthrough)) to remove recent GCC warnings
2 parents 5ed329e + 13bace4 commit 786e405

File tree

1 file changed

+2
-0
lines changed
  • libraries/Wire/src/utility

1 file changed

+2
-0
lines changed

Diff for: libraries/Wire/src/utility/twi.c

+2
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ ISR(TWI_vect)
445445
case TW_MR_DATA_ACK: // data received, ack sent
446446
// put byte into buffer
447447
twi_masterBuffer[twi_masterBufferIndex++] = TWDR;
448+
__attribute__ ((fallthrough));
448449
case TW_MR_SLA_ACK: // address sent, ack received
449450
// ack if more bytes are expected, otherwise nack
450451
if(twi_masterBufferIndex < twi_masterBufferLength){
@@ -530,6 +531,7 @@ ISR(TWI_vect)
530531
twi_txBufferLength = 1;
531532
twi_txBuffer[0] = 0x00;
532533
}
534+
__attribute__ ((fallthrough));
533535
// transmit first byte from buffer, fall
534536
case TW_ST_DATA_ACK: // byte sent, ack returned
535537
// copy data to output register

0 commit comments

Comments
 (0)