Restore the correct handling of the ACK flag at read completion.

This commit is contained in:
px4dev 2013-01-23 20:17:28 -08:00
parent dc88dd0abb
commit 51c47769f8
1 changed files with 1 additions and 1 deletions

View File

@ -1225,11 +1225,11 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv)
/* Disable acknowledge when last byte is to be received */ /* Disable acknowledge when last byte is to be received */
priv->dcnt--;
if (priv->dcnt == 1) if (priv->dcnt == 1)
{ {
stm32_i2c_modifyreg(priv, STM32_I2C_CR1_OFFSET, I2C_CR1_ACK, 0); stm32_i2c_modifyreg(priv, STM32_I2C_CR1_OFFSET, I2C_CR1_ACK, 0);
} }
priv->dcnt--;
#ifdef CONFIG_I2C_POLLED #ifdef CONFIG_I2C_POLLED
irqrestore(state); irqrestore(state);