Merge pull request from geertu/i2c-scan-fixes

I2c scan fixes and cleanups
This commit is contained in:
enjoy-digital 2021-01-15 17:50:20 +01:00 committed by GitHub
commit 2cb4f513f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
litex/soc/software/bios/cmds

View File

@ -135,10 +135,10 @@ static void i2c_scan_handler(int nb_params, char **params)
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 & 0x70);
}
if (i2c_poll(slave_addr)) {
printf(" %02x");
printf(" %02x", slave_addr);
} else {
printf(" --");
}