Skip to content

Commit

Permalink
Do not include address 0 (general call) when scanning
Browse files Browse the repository at this point in the history
CL: rpc-service-i2c: Do not include address 0 (general call) when scanning

PUBLISHED_FROM=963f746fd87bd9ba9ce6593216b25bce9622e0ba
  • Loading branch information
Deomid Ryabkov authored and cesantabot committed Jan 30, 2019
1 parent 8d09ea4 commit 28b69d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mgos_i2c_service.c
Expand Up @@ -39,7 +39,7 @@ static void i2c_scan_handler(struct mg_rpc_request_info *ri, void *cb_arg,
}
mbuf_init(&rb, 0);
json_printf(&out, "[");
for (int addr = 0; addr < 0x78; addr++) {
for (int addr = 1; addr < 0x78; addr++) {
if (mgos_i2c_write(i2c, addr, NULL, 0, true /* stop */)) {
json_printf(&out, "%s%d", (rb.len > 1 ? ", " : ""), addr);
}
Expand Down

0 comments on commit 28b69d2

Please sign in to comment.