9
0
Fork 0

Fix bugs in STM32 SDHC and I2C drivers

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4020 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2011-10-05 01:22:49 +00:00
parent 0ac452aba5
commit 54057d662f
4 changed files with 17 additions and 5 deletions

View File

@ -2134,3 +2134,12 @@
* arch/arm/src/sam3u/sam3u_spi.c: Add an SPI driver for the AT91SAM3U.
* drivers/input/ads7843e.c and include/nuttx/input/ads7843e.h: Add a
driver for the TI ADS7843E touchscreen controller.
* fs/nxffs/nxffs_open.c: Fix an error when a file is open for writing; since
the file will get deleted it is already exists, there must be a check if
there are other open references to the file.
* arch/arm/src/stm32/stm32_sdio.c: Fixed an error where during SDHC
initialization interrupts were not being re-enabled. Caused more subtle
errors than you would think.
* arch/arm/src/stm32/stm32_i2c.c: Fixed an error where I2C timeouts appeared
to be successful transfers.

View File

@ -1212,12 +1212,12 @@ static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
/* Configure pins */
if (stm32_configgpio(GPIO_I2C1_SCL)==ERROR)
if (stm32_configgpio(GPIO_I2C1_SCL) < 0)
{
return ERROR;
}
if (stm32_configgpio(GPIO_I2C1_SDA)==ERROR)
if (stm32_configgpio(GPIO_I2C1_SDA) < 0)
{
stm32_unconfiggpio(GPIO_I2C1_SCL);
return ERROR;
@ -1246,12 +1246,12 @@ static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
/* Configure pins */
if (stm32_configgpio(GPIO_I2C2_SCL)==ERROR)
if (stm32_configgpio(GPIO_I2C2_SCL) < 0)
{
return ERROR;
}
if (stm32_configgpio(GPIO_I2C2_SDA)==ERROR)
if (stm32_configgpio(GPIO_I2C2_SDA) < 0)
{
stm32_unconfiggpio(GPIO_I2C2_SCL);
return ERROR;
@ -1451,7 +1451,7 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms
* the BUSY flag.
*/
if (stm32_i2c_sem_waitdone(priv) == ERROR)
if (stm32_i2c_sem_waitdone(priv) < 0)
{
status = stm32_i2c_getstatus(priv);
errval = ETIMEDOUT;

View File

@ -1411,6 +1411,8 @@ static void stm32_reset(FAR struct sdio_dev_s *dev)
/* (Re-)enable clocking */
putreg32(1, SDIO_CLKCR_CLKEN_BB);
irqrestore(flags);
fvdbg("CLCKR: %08x POWER: %08x\n",
getreg32(STM32_SDIO_CLKCR), getreg32(STM32_SDIO_POWER));
}

View File

@ -1187,6 +1187,7 @@ int tsc2007_register(FAR struct i2c_dev_s *dev,
*/
#ifdef CONFIG_TSC2007_MULTIPLE
flags = irqsave();
priv->flink = g_tsc2007list;
g_tsc2007list = priv;
irqrestore(flags);