From ecd768a9e25ba55399f24a72467604eab75109b4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 25 May 2014 07:53:00 -0600 Subject: [PATCH] Back out PX4 fixes that were reverted in PX4 repository --- ChangeLog | 2 ++ arch/arm/src/stm32/stm32_i2c.c | 14 +------------- arch/arm/src/stm32/stm32_i2c_alt.c | 14 +------------- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e45cdc8ba..0c91ae15d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7375,3 +7375,5 @@ From Hannes Delago (2014-5-25). * include/nuttx/mtd/mtd.h: Needs forward reference to struct spi_dev_s. (2014-5-25). + * arch/arm/src/stm32/stm32_i2c.c and stm32_i2c_alt.c: Back out PX4 fixes + that were reverted in the PX4 repositories (2014-5-25). diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index d113af6112..bc71324e8f 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -1632,14 +1632,7 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms stm32_i2c_clrstart(priv); - /* Old transfers are done - * - * Reset ptr and dcnt to ensure an unexpected data interrupt doesn't - * overwrite stale data. - */ - - priv->dcnt = 0; - priv->ptr = NULL; + /* Old transfers are done */ priv->msgv = msgs; priv->msgc = count; @@ -1776,11 +1769,6 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms stm32_i2c_enablefsmc(ahbenr); stm32_i2c_sem_post(dev); - /* Ensure that any ISR happening after we finish can't overwrite any user data */ - - priv->dcnt = 0; - priv->ptr = NULL; - return -errval; } diff --git a/arch/arm/src/stm32/stm32_i2c_alt.c b/arch/arm/src/stm32/stm32_i2c_alt.c index 5ff9a0da9f..11e82629bb 100755 --- a/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/arch/arm/src/stm32/stm32_i2c_alt.c @@ -2134,14 +2134,7 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms stm32_i2c_clrstart(priv); - /* Old transfers are done - * - * Reset ptr and dcnt to ensure an unexpected data interrupt doesn't - * overwrite stale data. - */ - - priv->dcnt = 0; - priv->ptr = NULL; + /* Old transfers are done */ priv->msgv = msgs; priv->msgc = count; @@ -2304,11 +2297,6 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms stm32_i2c_enablefsmc(ahbenr); stm32_i2c_sem_post(dev); - /* Ensure that any ISR happening after we finish can't overwrite any user data */ - - priv->dcnt = 0; - priv->ptr = NULL; - return -errval; }