From 60e459599ae7e44f17f8304bb414762a9fcb7427 Mon Sep 17 00:00:00 2001 From: PascalGuenther Date: Fri, 25 Mar 2022 13:18:36 +0100 Subject: [PATCH] Fix: Must compare to STATUS, not to IF --- platform/emlib/src/em_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/emlib/src/em_i2c.c b/platform/emlib/src/em_i2c.c index 723954b231..4c6b8d5469 100644 --- a/platform/emlib/src/em_i2c.c +++ b/platform/emlib/src/em_i2c.c @@ -749,7 +749,7 @@ I2C_TransferReturn_TypeDef I2C_Transfer(I2C_TypeDef *i2c) // Errata I2C_E303. I2C Fails to Indicate New Incoming Data. uint32_t status = i2c->STATUS; // look for invalid RXDATAV = 0 and RXFULL = 1 condition - if (((status & I2C_IF_RXDATAV) == 0) & ((status & I2C_IF_RXFULL) != 0)) { + if (((status & I2C_STATUS_RXDATAV) == 0) & ((status & I2C_STATUS_RXFULL) != 0)) { // Performing a dummy read of the RXFIFO (I2C_RXDATA). // This restores the expected RXDATAV = 1 and RXFULL = 0 condition. (void)i2c->RXDATA;