mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-12-22 16:20:09 +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;
|
uint32_t isr = i2c->ISR;
|
||||||
if (isr & set)
|
if (isr & set)
|
||||||
return I2C_BUS_SUCCESS;
|
return I2C_BUS_SUCCESS;
|
||||||
if (isr & I2C_ISR_NACKF)
|
if (isr & I2C_ISR_NACKF) {
|
||||||
|
i2c->ICR = I2C_ICR_NACKCF;
|
||||||
return I2C_BUS_NACK;
|
return I2C_BUS_NACK;
|
||||||
|
}
|
||||||
if (!timer_is_before(timer_read_time(), timeout))
|
if (!timer_is_before(timer_read_time(), timeout))
|
||||||
return I2C_BUS_TIMEOUT;
|
return I2C_BUS_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user