From ee1ea9baab8ae485c0e14a5e559a93dc16ac3b01 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 18 Nov 2020 15:13:47 +0100 Subject: [PATCH] bios/cmd/cmd_i2c: make results similar to Linux's i2cdetect. --- litex/soc/software/bios/cmds/cmd_i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/litex/soc/software/bios/cmds/cmd_i2c.c b/litex/soc/software/bios/cmds/cmd_i2c.c index 7ef014cea..c0f32a619 100644 --- a/litex/soc/software/bios/cmds/cmd_i2c.c +++ b/litex/soc/software/bios/cmds/cmd_i2c.c @@ -132,15 +132,15 @@ static void i2c_scan_handler(int nb_params, char **params) { int slave_addr; - printf("\n 0 1 2 3 4 5 6 7 8 9 a b c d e f"); + printf(" 0 1 2 3 4 5 6 7 8 9 a b c d e f"); for (slave_addr = 0; slave_addr < 0x80; slave_addr++) { if (slave_addr % 0x10 == 0) { - printf("\n0x%02x ", (slave_addr/0x10) * 0x10); + printf("\n0x%02x:", (slave_addr/0x10) * 0x10); } if (i2c_poll(slave_addr)) { - printf("+ "); + printf(" %02x"); } else { - printf(". "); + printf(" --"); } } printf("\n");