diff options
author | Andrew Tridgell <tridge@samba.org> | 2014-07-10 13:31:00 +1000 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-12 16:05:47 +0200 |
commit | 047ed5c93fc127163ec1fa2854f977962a94c2f5 (patch) | |
tree | 4a7bb87ab69eb87ae10da253b980aebaa1df7a25 /nuttx/arch/arm | |
parent | b77beb3a51afee96b2e10e19b005c25225b3618c (diff) | |
download | px4-nuttx-047ed5c93fc127163ec1fa2854f977962a94c2f5.tar.gz px4-nuttx-047ed5c93fc127163ec1fa2854f977962a94c2f5.tar.bz2 px4-nuttx-047ed5c93fc127163ec1fa2854f977962a94c2f5.zip |
stm32_i2c: fixed timeout handling
thanks to hxxnrx@gmail.com for noticing this
Diffstat (limited to 'nuttx/arch/arm')
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_i2c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c index 996e8af39..c6587d308 100644 --- a/nuttx/arch/arm/src/stm32/stm32_i2c.c +++ b/nuttx/arch/arm/src/stm32/stm32_i2c.c @@ -1582,7 +1582,7 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms #if CONFIG_STM32_I2CTIMEOUS_START_STOP > 0 stm32_i2c_sem_waitstop(priv, CONFIG_STM32_I2CTIMEOUS_START_STOP); #else - stm32_i2c_sem_waitstop(priv, CONFIG_STM32_I2CTIMEOMS + CONFIG_STM32_I2CTIMEOSEC * 1000000); + stm32_i2c_sem_waitstop(priv, CONFIG_STM32_I2CTIMEOMS * 1000UL + CONFIG_STM32_I2CTIMEOSEC * 1000000UL); #endif #endif @@ -1622,7 +1622,7 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms timeout_us = CONFIG_STM32_I2CTIMEOUS_PER_BYTE * bytecount; //i2cvdbg("i2c wait: %d\n", timeout_us); #else - timeout_us = CONFIG_STM32_I2CTIMEOMS + CONFIG_STM32_I2CTIMEOSEC * 1000000; + timeout_us = CONFIG_STM32_I2CTIMEOMS * 1000UL + CONFIG_STM32_I2CTIMEOSEC * 1000000UL; #endif /* Reset I2C trace logic */ |