Skip to content

Commit

Permalink
stm32f0_i2c: define NACK
Browse files Browse the repository at this point in the history
Signed-off-by: Timofey Titovets <[email protected]>
  • Loading branch information
nefelim4ag committed Sep 12, 2024
1 parent 14a8310 commit 6f62b5d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/stm32/stm32f0_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit 6f62b5d

Please sign in to comment.