mirror of
https://github.com/Klipper3d/klipper.git
synced 2026-03-21 02:02:12 -06:00
stm32: f0 i2c clean nackcf interrupt on handle
Some checks failed
Build test / build (push) Has been cancelled
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
parent
a9cf02c412
commit
938300f3c3
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue