Fix some time value changes; mostly changing greater than 1000000000 to greater than or equal to 1000000000. From Juha Niskanen
This commit is contained in:
parent
2532e33de2
commit
ac0cd3655a
@ -638,7 +638,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
#ifdef CONFIG_STM32_I2C_DYNTIMEO
|
#ifdef CONFIG_STM32_I2C_DYNTIMEO
|
||||||
abstime.tv_nsec += 1000 * stm32_i2c_tousecs(priv->msgc, priv->msgv);
|
abstime.tv_nsec += 1000 * stm32_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;
|
||||||
@ -646,7 +646,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
#elif CONFIG_STM32_I2CTIMEOMS > 0
|
#elif CONFIG_STM32_I2CTIMEOMS > 0
|
||||||
abstime.tv_nsec += CONFIG_STM32_I2CTIMEOMS * 1000 * 1000;
|
abstime.tv_nsec += CONFIG_STM32_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;
|
||||||
|
@ -646,7 +646,7 @@ static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
#ifdef CONFIG_STM32_I2C_DYNTIMEO
|
#ifdef CONFIG_STM32_I2C_DYNTIMEO
|
||||||
abstime.tv_nsec += 1000 * stm32_i2c_tousecs(priv->msgc, priv->msgv);
|
abstime.tv_nsec += 1000 * stm32_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;
|
||||||
@ -654,7 +654,7 @@ static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
#elif CONFIG_STM32_I2CTIMEOMS > 0
|
#elif CONFIG_STM32_I2CTIMEOMS > 0
|
||||||
abstime.tv_nsec += CONFIG_STM32_I2CTIMEOMS * 1000 * 1000;
|
abstime.tv_nsec += CONFIG_STM32_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;
|
||||||
|
@ -673,7 +673,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
#ifdef CONFIG_STM32_I2C_DYNTIMEO
|
#ifdef CONFIG_STM32_I2C_DYNTIMEO
|
||||||
abstime.tv_nsec += 1000 * stm32_i2c_tousecs(priv->msgc, priv->msgv);
|
abstime.tv_nsec += 1000 * stm32_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;
|
||||||
@ -681,7 +681,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
#elif CONFIG_STM32_I2CTIMEOMS > 0
|
#elif CONFIG_STM32_I2CTIMEOMS > 0
|
||||||
abstime.tv_nsec += CONFIG_STM32_I2CTIMEOMS * 1000 * 1000;
|
abstime.tv_nsec += CONFIG_STM32_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;
|
||||||
|
@ -812,7 +812,7 @@ static inline int tiva_i2c_sem_waitdone(struct tiva_i2c_priv_s *priv)
|
|||||||
|
|
||||||
#ifdef CONFIG_TIVA_I2C_DYNTIMEO
|
#ifdef CONFIG_TIVA_I2C_DYNTIMEO
|
||||||
abstime.tv_nsec += 1000 * tiva_i2c_tousecs(priv->msgc, priv->msgv);
|
abstime.tv_nsec += 1000 * tiva_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;
|
||||||
@ -820,7 +820,7 @@ static inline int tiva_i2c_sem_waitdone(struct tiva_i2c_priv_s *priv)
|
|||||||
|
|
||||||
#elif CONFIG_TIVA_I2C_TIMEOMS > 0
|
#elif CONFIG_TIVA_I2C_TIMEOMS > 0
|
||||||
abstime.tv_nsec += CONFIG_TIVA_I2C_TIMEOMS * 1000 * 1000;
|
abstime.tv_nsec += CONFIG_TIVA_I2C_TIMEOMS * 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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user