summaryrefslogtreecommitdiff
path: root/avr
diff options
context:
space:
mode:
authorLeo C2016-09-10 01:51:36 +0200
committerLeo C2016-09-10 01:51:36 +0200
commit7af9364ebd7ad6c143f31e9abe745c6d75f8322b (patch)
treec7ce8ced4962f807f545814f4279dff9c9d45496 /avr
parentb30c4e8f1aef96f6fdc93da9f125545f5f74d06e (diff)
downloadz180-stamp-7af9364ebd7ad6c143f31e9abe745c6d75f8322b.zip
Adaptions for fatfs R0.12b
Diffstat (limited to 'avr')
-rw-r--r--avr/cmd_fat.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/avr/cmd_fat.c b/avr/cmd_fat.c
index 6ffbb79..fcf5cbc 100644
--- a/avr/cmd_fat.c
+++ b/avr/cmd_fat.c
@@ -69,21 +69,21 @@ static const FLASH char * const FLASH rc_names[] = {
FSTR("TIMEOUT"),
FSTR("LOCKED"),
FSTR("NOT_ENOUGH_CORE"),
- FSTR("TOO_MANY_OPEN_FILES")
+ FSTR("TOO_MANY_OPEN_FILES"),
+ FSTR("INVALID_PARAMETER")
};
static
void put_rc (FRESULT rc)
{
- if (rc < ARRAY_SIZE(rc_names)) {
#if GCC_BUG_61443
- printf_P(PSTR("rc=%u FR_"), rc);
- my_puts_P(rc_names[rc]);
- my_puts_P(PSTR("\n"));
+ printf_P(PSTR("rc=%u FR_"), rc);
+ my_puts_P(rc < ARRAY_SIZE(rc_names) ? rc_names[rc] : PSTR(" Unknown Error"));
+ my_puts_P(PSTR("\n"));
#else
- printf_P(PSTR("rc=%u FR_%S\n"), rc, rc_names[rc]);
+ printf_P(PSTR("rc=%u FR_%S\n"), rc,
+ rc < ARRAY_SIZE(rc_names) ? rc_names[rc] : PSTR(" Unknown Error"));
#endif
- }
}
@@ -236,11 +236,6 @@ command_ret_t do_fat_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[
unsigned long p1;
unsigned int s1, s2;
FRESULT res;
-#if _USE_LFN
- char Lfname[_MAX_LFN+1];
- Finfo.lfname = Lfname;
- Finfo.lfsize = sizeof Lfname;
-#endif
(void) cmdtp; (void) flag; (void) argc;
@@ -260,19 +255,15 @@ command_ret_t do_fat_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[
} else {
s1++; p1 += Finfo.fsize;
}
- printf_P(PSTR("%c%c%c%c%c %u/%02u/%02u %02u:%02u %9lu "),
+ printf_P(PSTR("%c%c%c%c%c %u/%02u/%02u %02u:%02u %9lu %s\n"),
(Finfo.fattrib & AM_DIR) ? 'D' : '-',
(Finfo.fattrib & AM_RDO) ? 'R' : '-',
(Finfo.fattrib & AM_HID) ? 'H' : '-',
(Finfo.fattrib & AM_SYS) ? 'S' : '-',
(Finfo.fattrib & AM_ARC) ? 'A' : '-',
(Finfo.fdate >> 9) + 1980, (Finfo.fdate >> 5) & 15, Finfo.fdate & 31,
- (Finfo.ftime >> 11), (Finfo.ftime >> 5) & 63, Finfo.fsize);
-#if _USE_LFN
- printf_P(PSTR("%s\n"), *Lfname ? Lfname : Finfo.fname);
-#else
- printf_P(PSTR("%s\n"), Finfo.fname);
-#endif
+ (Finfo.ftime >> 11), (Finfo.ftime >> 5) & 63,
+ Finfo.fsize, Finfo.fname);
if (check_abort())
break;
}
@@ -301,11 +292,6 @@ FRESULT mkpath(TCHAR *path)
TCHAR *p, *q;
FRESULT ret;
-#if _USE_LFN
- fd.lfname = 0;
-#endif
-
-
res = f_stat (path, &fd)
p = strchr(path, ':');