storage: flash_map: shell: Show device pointer instead of ID
The commit changes flash_map list output to display flash_map assigned pointer instead of device ID which was not propagated anyway. The commit also fixes formatting of the output. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
parent
a5515d43a5
commit
77f21ce966
1 changed files with 5 additions and 5 deletions
|
@ -24,17 +24,17 @@ static void fa_cb(const struct flash_area *fa, void *user_data)
|
||||||
{
|
{
|
||||||
struct shell *shell = user_data;
|
struct shell *shell = user_data;
|
||||||
|
|
||||||
shell_print(shell, "%-4d %-8d %-20s 0x%-10x 0x%-12x",
|
shell_print(shell, "%2d 0x%0*"PRIxPTR" %-26s 0x%-10x 0x%-12x",
|
||||||
fa->fa_id, fa->fa_device_id, fa->fa_dev->name,
|
(int)fa->fa_id, sizeof(uintptr_t) * 2, (uintptr_t)fa->fa_dev, fa->fa_dev->name,
|
||||||
(uint32_t) fa->fa_off, fa->fa_size);
|
(uint32_t) fa->fa_off, fa->fa_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cmd_flash_map_list(const struct shell *shell, size_t argc,
|
static int cmd_flash_map_list(const struct shell *shell, size_t argc,
|
||||||
char **argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
shell_print(shell, "ID | Device | Device Name"
|
shell_print(shell, "ID | Device | Device Name "
|
||||||
" | Offset | Size");
|
"| Offset | Size");
|
||||||
shell_print(shell, "-------------------------"
|
shell_print(shell, "-----------------------------------------"
|
||||||
"------------------------------");
|
"------------------------------");
|
||||||
flash_area_foreach(fa_cb, (struct shell *)shell);
|
flash_area_foreach(fa_cb, (struct shell *)shell);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue