Commit a97d113e authored by schneider's avatar schneider
Browse files

Merge branch 'schneider/fix-i2c-loop' into 'master'

fix(sdk): Prevent endless loop on I2C error

Closes #226

See merge request !465
parents dfcb2590 99fb7112
Pipeline #5179 passed with stages
in 1 minute and 16 seconds
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment