Explicitly tag fall throughs to try to help gcc not warn

pull/912/head
Jesse Vincent 4 years ago
parent fc2f89190a
commit 0f1e35d42f
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -400,7 +400,7 @@ void twi_releaseBus(void) {
ISR(TWI_vect) { ISR(TWI_vect) {
switch (TW_STATUS) { switch (TW_STATUS) {
// All Master // All Master
case TW_START: // sent start condition case TW_START: // sent start condition - fall through
case TW_REP_START: // sent repeated start condition case TW_REP_START: // sent repeated start condition
// copy device address and r/w bit to output register and ack // copy device address and r/w bit to output register and ack
TWDR = twi_slarw; TWDR = twi_slarw;
@ -408,7 +408,7 @@ ISR(TWI_vect) {
break; break;
// Master Transmitter // Master Transmitter
case TW_MT_SLA_ACK: // slave receiver acked address case TW_MT_SLA_ACK: // slave receiver acked address - fall through
case TW_MT_DATA_ACK: // slave receiver acked data case TW_MT_DATA_ACK: // slave receiver acked data
// if there is data to send, send it, otherwise stop // if there is data to send, send it, otherwise stop
if (twi_masterBufferIndex < twi_masterBufferLength) { if (twi_masterBufferIndex < twi_masterBufferLength) {
@ -442,11 +442,11 @@ ISR(TWI_vect) {
break; break;
// Master Receiver // Master Receiver
case TW_MR_DATA_ACK: // data received, ack sent case TW_MR_DATA_ACK: // data received, ack sent fall through
// put byte into buffer // put byte into buffer
twi_masterBuffer[twi_masterBufferIndex++] = TWDR; twi_masterBuffer[twi_masterBufferIndex++] = TWDR;
/* intentionally fall through */ /* intentionally fall through */
case TW_MR_SLA_ACK: // address sent, ack received case TW_MR_SLA_ACK: // address sent, ack received
// ack if more bytes are expected, otherwise nack // ack if more bytes are expected, otherwise nack
if (twi_masterBufferIndex < twi_masterBufferLength) { if (twi_masterBufferIndex < twi_masterBufferLength) {
twi_reply(1); twi_reply(1);
@ -475,17 +475,17 @@ ISR(TWI_vect) {
#if ENABLE_TWI_SLAVE_MODE #if ENABLE_TWI_SLAVE_MODE
// Slave Receiver // Slave Receiver
case TW_SR_SLA_ACK: // addressed, returned ack case TW_SR_SLA_ACK: // addressed, returned ack - fall through
case TW_SR_GCALL_ACK: // addressed generally, returned ack case TW_SR_GCALL_ACK: // addressed generally, returned ack - fall through
case TW_SR_ARB_LOST_SLA_ACK: // lost arbitration, returned ack case TW_SR_ARB_LOST_SLA_ACK: // lost arbitration, returned ack - fall through
case TW_SR_ARB_LOST_GCALL_ACK: // lost arbitration, returned ack case TW_SR_ARB_LOST_GCALL_ACK: // lost arbitration, returned ack - fall through
// enter slave receiver mode // enter slave receiver mode
twi_state = TWI_SRX; twi_state = TWI_SRX;
// indicate that rx buffer can be overwritten and ack // indicate that rx buffer can be overwritten and ack
twi_rxBufferIndex = 0; twi_rxBufferIndex = 0;
twi_reply(1); twi_reply(1);
break; break;
case TW_SR_DATA_ACK: // data received, returned ack case TW_SR_DATA_ACK: // data received, returned ack - fall through
case TW_SR_GCALL_DATA_ACK: // data received generally, returned ack case TW_SR_GCALL_DATA_ACK: // data received generally, returned ack
// if there is still room in the rx buffer // if there is still room in the rx buffer
if (twi_rxBufferIndex < TWI_BUFFER_LENGTH) { if (twi_rxBufferIndex < TWI_BUFFER_LENGTH) {
@ -509,14 +509,14 @@ ISR(TWI_vect) {
// since we submit rx buffer to "wire" library, we can reset it // since we submit rx buffer to "wire" library, we can reset it
twi_rxBufferIndex = 0; twi_rxBufferIndex = 0;
break; break;
case TW_SR_DATA_NACK: // data received, returned nack case TW_SR_DATA_NACK: // data received, returned nack - fall through
case TW_SR_GCALL_DATA_NACK: // data received generally, returned nack case TW_SR_GCALL_DATA_NACK: // data received generally, returned nack
// nack back at master // nack back at master
twi_reply(0); twi_reply(0);
break; break;
// Slave Transmitter // Slave Transmitter
case TW_ST_SLA_ACK: // addressed, returned ack case TW_ST_SLA_ACK: // addressed, returned ack - fall through
case TW_ST_ARB_LOST_SLA_ACK: // arbitration lost, returned ack case TW_ST_ARB_LOST_SLA_ACK: // arbitration lost, returned ack
// enter slave transmitter mode // enter slave transmitter mode
twi_state = TWI_STX; twi_state = TWI_STX;
@ -543,7 +543,7 @@ ISR(TWI_vect) {
twi_reply(0); twi_reply(0);
} }
break; break;
case TW_ST_DATA_NACK: // received nack, we are done case TW_ST_DATA_NACK: // received nack, we are done - fall through
case TW_ST_LAST_DATA: // received ack, but we are done already! case TW_ST_LAST_DATA: // received ack, but we are done already!
// ack future responses // ack future responses
twi_reply(1); twi_reply(1);

Loading…
Cancel
Save