aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/KINETIS/LLD/I2Cv1
diff options
context:
space:
mode:
authorKonstantin Oblaukhov <oblaukhov.konstantin@gmail.com>2018-10-07 18:34:01 +0700
committerKonstantin K. Oblaukhov <oblaukhov.konstantin@gmail.com>2018-11-20 09:53:30 +0700
commitd921781a45a5e2f57e56bf59872e1d2aec2fb71f (patch)
tree1c54eedb55550ccceb108cdaa84b47cd6869961f /os/hal/ports/KINETIS/LLD/I2Cv1
parentd200007a2985ed585a674bccb683b1bc953b2e36 (diff)
downloadChibiOS-Contrib-d921781a45a5e2f57e56bf59872e1d2aec2fb71f.tar.gz
ChibiOS-Contrib-d921781a45a5e2f57e56bf59872e1d2aec2fb71f.tar.bz2
ChibiOS-Contrib-d921781a45a5e2f57e56bf59872e1d2aec2fb71f.zip
KINETIS platform update for ChibiOS 18.2.x.
Diffstat (limited to 'os/hal/ports/KINETIS/LLD/I2Cv1')
-rw-r--r--os/hal/ports/KINETIS/LLD/I2Cv1/driver.mk9
-rw-r--r--os/hal/ports/KINETIS/LLD/I2Cv1/hal_i2c_lld.c6
2 files changed, 13 insertions, 2 deletions
diff --git a/os/hal/ports/KINETIS/LLD/I2Cv1/driver.mk b/os/hal/ports/KINETIS/LLD/I2Cv1/driver.mk
new file mode 100644
index 0000000..19658e5
--- /dev/null
+++ b/os/hal/ports/KINETIS/LLD/I2Cv1/driver.mk
@@ -0,0 +1,9 @@
+ifeq ($(USE_SMART_BUILD),yes)
+ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),)
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/KINETIS/LLD/I2Cv1/hal_i2c_lld.c
+endif
+else
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/KINETIS/LLD/I2Cv1/hal_i2c_lld.c
+endif
+
+PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/KINETIS/LLD/I2Cv1
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();