Code: Select all
uint8_t addr = 0xFF << 1;
i2cMasterReceiveTimeout(drv, addr, NULL, 0, TIME_S2I(2));
On oscilloscope i have next case. SCL is on low state and that's finish. No operations are allowed until restart of board.
I have added next fix and failed command doesn't brake I2C anymore.
Code: Select all
diff --git a/os/hal/lib/fallback/I2C/hal_i2c_lld.c b/os/hal/lib/fallback/I2C/hal_i2c_lld.c
index e4ae9a9f9..37b3cb3ed 100644
--- a/os/hal/lib/fallback/I2C/hal_i2c_lld.c
+++ b/os/hal/lib/fallback/I2C/hal_i2c_lld.c
@@ -32,6 +32,8 @@
#define CHECK_ERROR(msg) \
if ((msg) < (msg_t)0) { \
+ palSetLine(i2cp->config->sda); \^M
+ palSetLine(i2cp->config->scl); \^M
return MSG_TIMEOUT; \
}
Any other opinions about this case?