mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
Merged in masayuki2009/nuttx.nuttx/fix_efm32_i2c_timeout (pull request #312)
EFM32 I2C: Fix timeout calculation Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
@@ -553,7 +553,7 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
#ifdef CONFIG_EFM32_I2C_DYNTIMEO
|
#ifdef CONFIG_EFM32_I2C_DYNTIMEO
|
||||||
abstime.tv_nsec += 1000 * efm32_i2c_tousecs(priv->msgc, priv->msgv);
|
abstime.tv_nsec += 1000 * efm32_i2c_tousecs(priv->msgc, priv->msgv);
|
||||||
if (abstime.tv_nsec > 1000 * 1000 * 1000)
|
if (abstime.tv_nsec >= 1000 * 1000 * 1000)
|
||||||
{
|
{
|
||||||
abstime.tv_sec++;
|
abstime.tv_sec++;
|
||||||
abstime.tv_nsec -= 1000 * 1000 * 1000;
|
abstime.tv_nsec -= 1000 * 1000 * 1000;
|
||||||
@@ -561,7 +561,7 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
#elif CONFIG_EFM32_I2CTIMEOMS > 0
|
#elif CONFIG_EFM32_I2CTIMEOMS > 0
|
||||||
abstime.tv_nsec += CONFIG_EFM32_I2CTIMEOMS * 1000 * 1000;
|
abstime.tv_nsec += CONFIG_EFM32_I2CTIMEOMS * 1000 * 1000;
|
||||||
if (abstime.tv_nsec > 1000 * 1000 * 1000)
|
if (abstime.tv_nsec >= 1000 * 1000 * 1000)
|
||||||
{
|
{
|
||||||
abstime.tv_sec++;
|
abstime.tv_sec++;
|
||||||
abstime.tv_nsec -= 1000 * 1000 * 1000;
|
abstime.tv_nsec -= 1000 * 1000 * 1000;
|
||||||
|
|||||||
Reference in New Issue
Block a user