diff options
author | Drashna Jael're <drashna@live.com> | 2022-03-25 16:19:22 -0700 |
---|---|---|
committer | Drashna Jael're <drashna@live.com> | 2022-03-25 16:19:22 -0700 |
commit | 53ff570bf068e04740f187163774327839dfa68b (patch) | |
tree | 5429e069fc593d484b0b479de422b51ac239be83 /platforms/avr/drivers/i2c_slave.c | |
parent | e8171efc7158ba4ebb24827680b19b775d366b1a (diff) | |
parent | efc9c525b19b33c6e09057218ea64f07f45f9555 (diff) |
Remerge 0.16.x' into firmware21
Diffstat (limited to 'platforms/avr/drivers/i2c_slave.c')
-rw-r--r-- | platforms/avr/drivers/i2c_slave.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/platforms/avr/drivers/i2c_slave.c b/platforms/avr/drivers/i2c_slave.c index 2907f164c0..660d271be2 100644 --- a/platforms/avr/drivers/i2c_slave.c +++ b/platforms/avr/drivers/i2c_slave.c @@ -29,7 +29,7 @@ # include "transactions.h" static volatile bool is_callback_executor = false; -#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) +#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT]; @@ -57,7 +57,7 @@ ISR(TWI_vect) { slave_has_register_set = false; #if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) is_callback_executor = false; -#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) +#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) break; case TW_SR_DATA_ACK: @@ -66,16 +66,16 @@ ISR(TWI_vect) { if (!slave_has_register_set) { buffer_address = TWDR; - if (buffer_address >= I2C_SLAVE_REG_COUNT) { // address out of bounds dont ack + if (buffer_address >= I2C_SLAVE_REG_COUNT) { // address out of bounds dont ack ack = 0; buffer_address = 0; } - slave_has_register_set = true; // address has been received now fill in buffer + slave_has_register_set = true; // address has been received now fill in buffer #if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) // Work out if we're attempting to execute a callback is_callback_executor = buffer_address == split_transaction_table[I2C_EXECUTE_CALLBACK].initiator2target_offset; -#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) +#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) } else { i2c_slave_reg[buffer_address] = TWDR; buffer_address++; @@ -88,7 +88,7 @@ ISR(TWI_vect) { trans->slave_callback(trans->initiator2target_buffer_size, split_trans_initiator2target_buffer(trans), trans->target2initiator_buffer_size, split_trans_target2initiator_buffer(trans)); } } -#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) +#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) } break; |