Merge I2C command handler into main #18

Merged
sebgab merged 15 commits from output-fan-data-over-i2c into main 2024-04-30 08:37:29 +00:00
Showing only changes of commit 91cffd78f4 - Show all commits

View File

@ -90,11 +90,10 @@ ISR(TWI0_TWIS_vect) {
// Check for the data interrupt flag // Check for the data interrupt flag
if (TWI0.SSTATUS & TWI_DIF_bm) { if (TWI0.SSTATUS & TWI_DIF_bm) {
uint8_t data = 0;
if (((TWI0.SSTATUS & TWI_DIR_bm) >> TWI_DIR_bp) == 0) { if (((TWI0.SSTATUS & TWI_DIR_bm) >> TWI_DIR_bp) == 0) {
// Data write Controller -> Target // Data write Controller -> Target
data = TWI0.SDATA; uint8_t data = TWI0.SDATA;
// Send the data to the write handler // Send the data to the write handler
i2c_write_handler(data); i2c_write_handler(data);