You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/04/24 17:24:47 UTC
(nuttx) branch master updated: lpc17_40 i2c: Fix I2C driver state desynchronization.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new b2659424d5 lpc17_40 i2c: Fix I2C driver state desynchronization.
b2659424d5 is described below
commit b2659424d59bfe60b58f243588cd69182ebb28a7
Author: Fotis Panagiotopoulos <f....@amco.gr>
AuthorDate: Wed Apr 24 12:34:45 2024 +0300
lpc17_40 i2c: Fix I2C driver state desynchronization.
---
arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c
index 252c9c9848..23eef26f95 100644
--- a/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c
+++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c
@@ -227,6 +227,8 @@ static int lpc17_40_i2c_start(struct lpc17_40_i2cdev_s *priv)
uint32_t timeout;
int i;
+ nxsem_reset(&priv->wait, 0);
+
putreg32(I2C_CONCLR_STAC | I2C_CONCLR_SIC,
priv->base + LPC17_40_I2C_CONCLR_OFFSET);
putreg32(I2C_CONSET_STA, priv->base + LPC17_40_I2C_CONSET_OFFSET);