diff --git a/source/shell/flash.c b/source/shell/flash.c index bebffd5..5c491c1 100644 --- a/source/shell/flash.c +++ b/source/shell/flash.c @@ -105,13 +105,14 @@ static void do_flash_probe(const char *s) } if (!(flash = flash_probe())) { - fprintf(stderr, "error: unable to probe flash device.\n"); + fprintf(stderr, "error: unable to probe the flash device.\n"); + return; } } static void do_flash_info(const char *s) { - size_t size; + size_t size, capacity; (void)s; @@ -121,10 +122,10 @@ static void do_flash_info(const char *s) } size = flash_get_size(flash); + capacity = flash_get_capacity(flash); - printf("Capacity: %" PRSZu " blocks (", size / (4 * KIB)); - print_size(size); - printf(")\n"); + printf(" size: %" PRSZu "/%" PRSZu " bytes (%" PRSZu "%% usage)\n", + size, capacity, 100 * size / capacity); } static void do_flash_read(const char *s)