From 6217cde586c406a2d4fb61be823e0da5c521b6ab Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Tue, 30 Nov 2021 02:30:12 +0300 Subject: [PATCH] Apply alvintpwang patch to fix read 24cXX issue; increase timeout on i2c_write_2b to fix write 24cXXwq issue --- 24cXX.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/24cXX.c b/24cXX.c index b9c790f..5239bf9 100644 --- a/24cXX.c +++ b/24cXX.c @@ -43,7 +43,7 @@ static int i2c_write_2b(struct eeprom *e, __u8 buf[2]) r = i2c_smbus_write_byte_data(e->fd, buf[0], buf[1]); if(r < 0) fprintf(stderr, "Error i2c_write_2b: %s\n", strerror(errno)); - usleep(10); + usleep(10000); return r; } @@ -69,7 +69,8 @@ static int i2c_write_3b(struct eeprom *e, __u8 buf[3]) int eeprom_open(char *dev_fqn, int addr, int type, struct eeprom* e) { - int funcs, fd, r; + unsigned long funcs; + int fd, r; e->fd = e->addr = 0; e->dev = 0;