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
3d40cd375f
commit
eee82177f5
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user