mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
software/bios/cmds/cmd_i2c: Simplify upper nibble calculation
Use masking instead of division and multiplication. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
parent
28ed06f1c5
commit
dc3306731c
1 changed files with 1 additions and 1 deletions
|
@ -135,7 +135,7 @@ 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", slave_addr);
|
||||
|
|
Loading…
Reference in a new issue