From 51c47769f8a3a451e1d54852280046472fb65757 Mon Sep 17 00:00:00 2001 From: px4dev Date: Wed, 23 Jan 2013 20:17:28 -0800 Subject: [PATCH] Restore the correct handling of the ACK flag at read completion. --- nuttx/arch/arm/src/stm32/stm32_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c index 80f1575042..a66ac7e290 100644 --- a/nuttx/arch/arm/src/stm32/stm32_i2c.c +++ b/nuttx/arch/arm/src/stm32/stm32_i2c.c @@ -1225,11 +1225,11 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) /* Disable acknowledge when last byte is to be received */ + priv->dcnt--; if (priv->dcnt == 1) { stm32_i2c_modifyreg(priv, STM32_I2C_CR1_OFFSET, I2C_CR1_ACK, 0); } - priv->dcnt--; #ifdef CONFIG_I2C_POLLED irqrestore(state);