From 91163251e6a5857c348912a4823c77fc29965328 Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Wed, 2 Feb 2022 10:39:52 +0100 Subject: [PATCH] Don't exit the debugger on I2C communication errors, just report them --- i2c-debugger.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/i2c-debugger.c b/i2c-debugger.c index 4f4fbcc..239d4d8 100644 --- a/i2c-debugger.c +++ b/i2c-debugger.c @@ -36,7 +36,12 @@ void dump_log(int fd) }; ret = ioctl(fd, I2C_RDWR, &msg); - syscall_error(ret < 0, "I2C_RDWR failed"); + if (ret < 0) { + printf("ERROR: (%"PRIu64") I2C_RDWR failed (%d)\n", time_abs(), errno); + fflush(stdout); + usleep(50000); + return; + } int i; for (i = 0; i < sizeof(buf) && buf[i]; i++);