Merge I2C command handler into main #18
@ -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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user