Skip to content
Snippets Groups Projects

fix(sdk): Prevent endless loop on I2C error

Merged schneider requested to merge schneider/fix-i2c-loop into master
1 file
+ 2
0
Compare changes
  • Side-by-side
  • Inline
@@ -404,6 +404,7 @@ int I2C_MasterRead(mxc_i2c_regs_t *i2c, uint8_t addr, uint8_t* data, int len, in
if (i2c->int_fl0 & I2C_ERROR) {
// Set the stop bit
i2c->master_ctrl |= MXC_F_I2C_MASTER_CTRL_STOP;
while (!(i2c->int_fl0 & (MXC_F_I2C_INT_FL0_STOP))) {}
return E_COMM_ERR;
}
@@ -416,6 +417,7 @@ int I2C_MasterRead(mxc_i2c_regs_t *i2c, uint8_t addr, uint8_t* data, int len, in
if (i2c->int_fl0 & I2C_ERROR) {
// Set the stop bit
i2c->master_ctrl |= MXC_F_I2C_MASTER_CTRL_STOP;
while (!(i2c->int_fl0 & (MXC_F_I2C_INT_FL0_STOP))) {}
return E_COMM_ERR;
}
Loading