Handle possible problem with unintentional I2C interrupt handler triggering
Error handler may be called repeatedly during I2C unstucking. Not sure if this change is necessary, but it is safe
This commit is contained in:
parent
5129403c83
commit
f9f40fb98f
|
@ -325,6 +325,9 @@ void i2cInit(I2CDevice index)
|
|||
I2Cx_index = index;
|
||||
RCC_APB1PeriphClockCmd(i2cHardwareMap[index].peripheral, ENABLE);
|
||||
|
||||
// diable I2C interrrupts first to avoid ER handler triggering
|
||||
I2C_ITConfig(I2Cx, I2C_IT_EVT | I2C_IT_ERR, DISABLE);
|
||||
|
||||
// clock out stuff to make sure slaves arent stuck
|
||||
// This will also configure GPIO as AF_OD at the end
|
||||
i2cUnstick();
|
||||
|
|
Loading…
Reference in New Issue