Skip to content

Commit 396faf6

Browse files
committed
Invoke i2c_change_addr in i2cdetect because some hosts get confused(novatek)
1 parent 9f3e044 commit 396faf6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/i2cspi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ static int i2cdetect(int argc, char **argv, bool script_mode) {
202202
i2c_addr = 0xff; // will be 0x00 after first increment
203203
do {
204204
++i2c_addr;
205-
int res = i2c_read_register(fd, i2c_addr, 0, SELECT_WIDE(0), 1);
205+
i2c_change_addr(fd, i2c_addr);
206+
int res = i2c_read_register(fd, i2c_addr, 0x00, SELECT_WIDE(0), 1);
206207

207208
if (i2c_addr % 16 == 0)
208209
printf("%4.x: ", i2c_addr);

0 commit comments

Comments
 (0)