From 6f62b5d21fd042226102dd31c75e4f8f98af707a Mon Sep 17 00:00:00 2001 From: Timofey Titovets Date: Thu, 12 Sep 2024 02:21:08 +0200 Subject: [PATCH] stm32f0_i2c: define NACK Signed-off-by: Timofey Titovets --- src/stm32/stm32f0_i2c.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stm32/stm32f0_i2c.c b/src/stm32/stm32f0_i2c.c index 597b48460eb7..d4c6326894ff 100644 --- a/src/stm32/stm32f0_i2c.c +++ b/src/stm32/stm32f0_i2c.c @@ -166,6 +166,8 @@ i2c_wait(I2C_TypeDef *i2c, uint32_t set, uint32_t timeout) uint32_t isr = i2c->ISR; if (isr & set) return isr; + if (isr & I2C_ISR_NACKF) + shutdown("I2C NACK error encountered!"); if (!timer_is_before(timer_read_time(), timeout)) shutdown("i2c timeout"); }