aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/KINETIS/LLD/hal_i2c_lld.c')
-rw-r--r--os/hal/ports/KINETIS/LLD/hal_i2c_lld.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c b/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c
index a005c32..f615dd5 100644
--- a/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c
+++ b/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c
@@ -442,7 +442,13 @@ 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)
end = start + OSAL_TIME_MS2I(KINETIS_I2C_BUSY_TIMEOUT);
+#elif defined(OSAL_TIME_MS2ST)
+ end = start + OSAL_TIME_MS2ST(KINETIS_I2C_BUSY_TIMEOUT);
+#else
+ end = start + OSAL_MS2ST(KINETIS_I2C_BUSY_TIMEOUT);
+#endif
while(true) {
osalSysLock();