diff options
author | marcoveeneman <marco-veeneman@hotmail.com> | 2017-11-24 22:25:12 +0100 |
---|---|---|
committer | marcoveeneman <marco-veeneman@hotmail.com> | 2017-11-24 22:25:12 +0100 |
commit | 19efef2f4a09244023a25086fd8ebabd4c38d982 (patch) | |
tree | 49cb98cd200fabd5fad6628e6124b0149958bd41 /os/hal/ports/TIVA/LLD/I2C | |
parent | 93dd54ecdcfce8ad063a4d951473f110e15c28df (diff) | |
download | ChibiOS-Contrib-19efef2f4a09244023a25086fd8ebabd4c38d982.tar.gz ChibiOS-Contrib-19efef2f4a09244023a25086fd8ebabd4c38d982.tar.bz2 ChibiOS-Contrib-19efef2f4a09244023a25086fd8ebabd4c38d982.zip |
Fixed hal_i2c_lld.c
Diffstat (limited to 'os/hal/ports/TIVA/LLD/I2C')
-rw-r--r-- | os/hal/ports/TIVA/LLD/I2C/hal_i2c_lld.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/os/hal/ports/TIVA/LLD/I2C/hal_i2c_lld.c b/os/hal/ports/TIVA/LLD/I2C/hal_i2c_lld.c index fd7395f..7ba7bad 100644 --- a/os/hal/ports/TIVA/LLD/I2C/hal_i2c_lld.c +++ b/os/hal/ports/TIVA/LLD/I2C/hal_i2c_lld.c @@ -778,7 +778,7 @@ msg_t i2c_lld_master_receive_timeout(I2CDriver *i2cp, i2caddr_t addr, /* Calculating the time window for the timeout on the busy bus condition.*/ start = osalOsGetSystemTimeX(); - end = start + OSAL_MS2ST(TIVA_I2C_BUSY_TIMEOUT); + end = start + OSAL_MS2I(TIVA_I2C_BUSY_TIMEOUT); /* Waits until BUSY flag is reset or, alternatively, for a timeout condition.*/ @@ -792,7 +792,7 @@ msg_t i2c_lld_master_receive_timeout(I2CDriver *i2cp, i2caddr_t addr, /* If the system time went outside the allowed window then a timeout condition is returned.*/ - if (!osalOsIsTimeWithinX(osalOsGetSystemTimeX(), start, end)) + if (!osalTimeIsInRangeX(osalOsGetSystemTimeX(), start, end)) return MSG_TIMEOUT; osalSysUnlock(); @@ -852,7 +852,7 @@ msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, i2caddr_t addr, /* Calculating the time window for the timeout on the busy bus condition.*/ start = osalOsGetSystemTimeX(); - end = start + OSAL_MS2ST(TIVA_I2C_BUSY_TIMEOUT); + end = start + OSAL_MS2I(TIVA_I2C_BUSY_TIMEOUT); /* Waits until BUSY flag is reset or, alternatively, for a timeout condition.*/ @@ -866,7 +866,8 @@ msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, i2caddr_t addr, /* If the system time went outside the allowed window then a timeout condition is returned.*/ - if (!osalOsIsTimeWithinX(osalOsGetSystemTimeX(), start, end)) + if (!osalTimeIsInRangeX(osalOsGetSystemTimeX(), start, end)) + return MSG_TIMEOUT; osalSysUnlock(); |