1
0
Fork 0

Next set of split_common changes (#4974)

* Update split_common to use standard i2c drivers

* Eliminate RGB_DIRTY/BACKLIT_DIRTY

* Fix avr i2c_master error handling

* Fix i2c_slave addressing

* Remove unneeded timeout on i2c_stop()

* Fix RGB I2C transfers

* Remove incorrect comment
This commit is contained in:
James Churchill 2019-03-13 03:23:28 +10:00 committed by Drashna Jaelre
parent 25bb059e4e
commit 37932c293c
24 changed files with 187 additions and 614 deletions

View file

@ -16,7 +16,7 @@ static volatile bool slave_has_register_set = false;
void i2c_slave_init(uint8_t address){
// load address into TWI address register
TWAR = (address << 1);
TWAR = address;
// set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt
TWCR = (1 << TWIE) | (1 << TWEA) | (1 << TWINT) | (1 << TWEN);
}