summaryrefslogtreecommitdiff
path: root/avr/cmd_fat.c
diff options
context:
space:
mode:
authorLeo C2018-07-22 10:21:02 +0200
committerLeo C2018-07-22 12:16:06 +0200
commit81a43faf77dc6b8aaa9f3b9cddb89dc1e9192ebd (patch)
tree55fcb8c74d01b85af5ea890427cb43e515cc4041 /avr/cmd_fat.c
parent177aa6a61bf776a3095308439f2ffb7bed5bfb8c (diff)
downloadz180-stamp-81a43faf77dc6b8aaa9f3b9cddb89dc1e9192ebd.zip
Bugfix do_stat(): Output formating (+ minor opt)
Diffstat (limited to 'avr/cmd_fat.c')
-rw-r--r--avr/cmd_fat.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/avr/cmd_fat.c b/avr/cmd_fat.c
index fcae8b0..52ad95f 100644
--- a/avr/cmd_fat.c
+++ b/avr/cmd_fat.c
@@ -105,9 +105,10 @@ static void swirl(void)
static uint32_t tstamp;
if (get_timer(0) > tstamp) {
- printf_P(PSTR("\b%c"), swirlchar[cnt]);
- cnt = (cnt+1) % ARRAY_SIZE(swirlchar);
tstamp = get_timer(0) + 250;
+ putchar('\b');
+ cnt = (cnt+1) & 3;
+ putchar(swirlchar[cnt]);
}
}
@@ -379,14 +380,15 @@ command_ret_t do_stat(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int arg
}
#endif
if (!res) {
- my_puts_P(PSTR("\nCounting... "));
statp.AccSize = statp.AccFiles = statp.AccDirs = 0;
strcpy(buf, path);
+ my_puts_P(PSTR("\nCounting... "));
res = scan_files(buf, &statp);
+ putchar('\r');
}
if (!res) {
- printf_P(PSTR("\r%u files, %lu bytes.\n%u folders.\n"
+ printf_P(PSTR("%u files, %lu bytes.\n%u folders.\n"
"%lu KB total disk space.\n%lu KB available.\n"),
statp.AccFiles, statp.AccSize, statp.AccDirs,
(fs->n_fatent - 2) * (fs->csize / 2), nfreeclst * (fs->csize / 2)