Skip to content

Commit df7ecd0

Browse files
committed
drivers: i2c: shell: use shell_fprintf_normal instead of shell_fprintf
Due to the introduction of `shell_fprintf_normal` in PR zephyrproject-rtos#77192, we can minimize caller overhead by eliminating direct `color` parameter passing. Signed-off-by: Pisit Sawangvonganan <[email protected]>
1 parent 72a14b1 commit df7ecd0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/i2c/i2c_shell.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ static int cmd_i2c_scan(const struct shell *sh, size_t argc, char **argv)
6161

6262
shell_print(sh, " 0 1 2 3 4 5 6 7 8 9 a b c d e f");
6363
for (uint8_t i = 0; i <= last; i += 16) {
64-
shell_fprintf(sh, SHELL_NORMAL, "%02x: ", i);
64+
shell_fprintf_normal(sh, "%02x: ", i);
6565
for (uint8_t j = 0; j < 16; j++) {
6666
if (i + j < first || i + j > last) {
67-
shell_fprintf(sh, SHELL_NORMAL, " ");
67+
shell_fprintf_normal(sh, " ");
6868
continue;
6969
}
7070

@@ -76,10 +76,10 @@ static int cmd_i2c_scan(const struct shell *sh, size_t argc, char **argv)
7676
msgs[0].len = 0U;
7777
msgs[0].flags = I2C_MSG_WRITE | I2C_MSG_STOP;
7878
if (i2c_transfer(dev, &msgs[0], 1, i + j) == 0) {
79-
shell_fprintf(sh, SHELL_NORMAL, "%02x ", i + j);
79+
shell_fprintf_normal(sh, "%02x ", i + j);
8080
++cnt;
8181
} else {
82-
shell_fprintf(sh, SHELL_NORMAL, "-- ");
82+
shell_fprintf_normal(sh, "-- ");
8383
}
8484
}
8585
shell_print(sh, "");

0 commit comments

Comments
 (0)