Fix bugs in STM32 SDHC and I2C drivers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4020 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
9c80d94163
commit
94a87532e2
@ -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.
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user