From 4e1ee919d48b80c87b79048697623e795126d950 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 18 Jan 2020 10:52:36 +0000 Subject: [PATCH] Fixed bug #1069. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13285 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/hal/lib/fallback/I2C/hal_i2c_lld.c | 6 ++++-- readme.txt | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/os/hal/lib/fallback/I2C/hal_i2c_lld.c b/os/hal/lib/fallback/I2C/hal_i2c_lld.c index f324333dc..e4ae9a9f9 100644 --- a/os/hal/lib/fallback/I2C/hal_i2c_lld.c +++ b/os/hal/lib/fallback/I2C/hal_i2c_lld.c @@ -94,7 +94,8 @@ static inline msg_t i2c_check_arbitration(I2CDriver *i2cp) { static inline msg_t i2c_check_timeout(I2CDriver *i2cp) { - if (!osalTimeIsInRangeX(osalOsGetSystemTimeX(), i2cp->start, i2cp->end)) { + if ((i2cp->start != i2cp->end) && + (!osalTimeIsInRangeX(osalOsGetSystemTimeX(), i2cp->start, i2cp->end))) { i2c_write_stop(i2cp); return MSG_TIMEOUT; } @@ -105,7 +106,8 @@ static inline msg_t i2c_check_timeout(I2CDriver *i2cp) { static msg_t i2c_wait_clock(I2CDriver *i2cp) { while (palReadLine(i2cp->config->scl) == PAL_LOW) { - if (!osalTimeIsInRangeX(osalOsGetSystemTimeX(), i2cp->start, i2cp->end)) { + if ((i2cp->start != i2cp->end) && + (!osalTimeIsInRangeX(osalOsGetSystemTimeX(), i2cp->start, i2cp->end))) { return MSG_TIMEOUT; } i2c_delay(i2cp); diff --git a/readme.txt b/readme.txt index a22780c02..faa11b283 100644 --- a/readme.txt +++ b/readme.txt @@ -154,6 +154,8 @@ - HAL: Added a new interface for range-finder devices (used by EX). - HAL: Added mcuconf.h updater tool for STM32F407 (backported to 19.1.1). - NIL: Integrated NIL 4.0. +- FIX: Fixed problem in the I2C fallback driver (bug #1069) + (backported to 19.1.4)(backported to 18.2.3). - FIX: Fixed TIM8 missing on STM32H7xx (bug #1068) (backported to 19.1.4)(backported to 18.2.3). - FIX: Fixed Sharing issues with GPT TIMv1 driver (bug #1067)