aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/KINETIS/LLD/I2Cv1/hal_i2c_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/KINETIS/LLD/I2Cv1/hal_i2c_lld.c')
-rw-r--r--os/hal/ports/KINETIS/LLD/I2Cv1/hal_i2c_lld.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/os/hal/ports/KINETIS/LLD/I2Cv1/hal_i2c_lld.c b/os/hal/ports/KINETIS/LLD/I2Cv1/hal_i2c_lld.c
index aa47aa3..6bb9f44 100644
--- a/os/hal/ports/KINETIS/LLD/I2Cv1/hal_i2c_lld.c
+++ b/os/hal/ports/KINETIS/LLD/I2Cv1/hal_i2c_lld.c
@@ -442,7 +442,9 @@ static inline msg_t _i2c_txrx_timeout(I2CDriver *i2cp, i2caddr_t addr,
/* wait until the bus is released */
/* Calculating the time window for the timeout on the busy bus condition.*/
start = osalOsGetSystemTimeX();
-#if defined(OSAL_TIME_MS2I)
+#if defined(OSAL_MS2I)
+ end = start + OSAL_MS2I(KINETIS_I2C_BUSY_TIMEOUT);
+#elif defined(OSAL_TIME_MS2I)
end = start + OSAL_TIME_MS2I(KINETIS_I2C_BUSY_TIMEOUT);
#elif defined(OSAL_TIME_MS2ST)
end = start + OSAL_TIME_MS2ST(KINETIS_I2C_BUSY_TIMEOUT);
@@ -458,7 +460,7 @@ static inline msg_t _i2c_txrx_timeout(I2CDriver *i2cp, i2caddr_t addr,
break;
/* 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();