File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ void _i2c_irq_handler(i2c_dev *dev) {
349349 */
350350 if (msg -> length > 1 ) {
351351 i2c_write (dev , msg -> data [msg -> xferred ++ ]);
352- } else if (msg -> length == 0 ){ /* We're just sending an address */
352+ } else if (msg -> length == 0 ) { /* We're just sending an address */
353353 i2c_stop_condition (dev );
354354 /*
355355 * Turn off event interrupts to keep BTF from firing until
Original file line number Diff line number Diff line change 4141uint8 HardWire::process () {
4242 int8 res = i2c_master_xfer (sel_hard, &itc_msg, 1 , 0 );
4343 if (res == I2C_ERROR_PROTOCOL) {
44- if (sel_hard->error_flags & I2C_SR1_AF)
44+ if (sel_hard->error_flags & I2C_SR1_AF) { /* NACK */
4545 res = (sel_hard->error_flags & I2C_SR1_ADDR ? ENACKADDR :
46- ENACKTRNS);
47- else if (sel_hard->error_flags & I2C_SR1_OVR) res = EDATA;
48- else res = EOTHER;
46+ ENACKTRNS);
47+ } else if (sel_hard->error_flags & I2C_SR1_OVR) { /* Over/Underrun */
48+ res = EDATA;
49+ } else { /* Bus or Arbitration error */
50+ res = EOTHER;
51+ }
4952 i2c_disable (sel_hard);
5053 i2c_master_enable (sel_hard, (I2C_BUS_RESET | dev_flags));
5154 }
You can’t perform that action at this time.
0 commit comments