mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-12-16 05:09:56 +01:00
stm32: f0 i2c clean nackcf interrupt on handle
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
committed by
KevinOConnor
parent
a9cf02c412
commit
938300f3c3
@@ -188,8 +188,10 @@ i2c_wait(I2C_TypeDef *i2c, uint32_t set, uint32_t timeout)
|
||||
uint32_t isr = i2c->ISR;
|
||||
if (isr & set)
|
||||
return I2C_BUS_SUCCESS;
|
||||
if (isr & I2C_ISR_NACKF)
|
||||
if (isr & I2C_ISR_NACKF) {
|
||||
i2c->ICR = I2C_ICR_NACKCF;
|
||||
return I2C_BUS_NACK;
|
||||
}
|
||||
if (!timer_is_before(timer_read_time(), timeout))
|
||||
return I2C_BUS_TIMEOUT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user