shell: Make sure digits of the device id are rendered with 2 hex digits

This is achieved by a simple change to the formatter, fixing it to 2 hex
digits with 0 padding.

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
This commit is contained in:
Daniel Egger 2019-03-08 13:43:05 +01:00 committed by Anas Nashif
parent 46c19ff18f
commit d4d75eb1da

View file

@ -30,7 +30,7 @@ static int cmd_get_device_id(const struct shell *shell, size_t argc, char **argv
shell_fprintf(shell, SHELL_NORMAL, "ID: 0x");
for (i = 0 ; i < length ; i++) {
shell_fprintf(shell, SHELL_NORMAL, "%x", dev_id[i]);
shell_fprintf(shell, SHELL_NORMAL, "%02x", dev_id[i]);
}
shell_fprintf(shell, SHELL_NORMAL, "\n");