]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
Adaptions for fatfs R0.12b
authorLeo C <erbl259-lmu@yahoo.de>
Fri, 9 Sep 2016 23:51:36 +0000 (01:51 +0200)
committerLeo C <erbl259-lmu@yahoo.de>
Fri, 9 Sep 2016 23:51:36 +0000 (01:51 +0200)
avr/cmd_fat.c
include/avr/ffconf.h
include/z180-serv.h
libopencm3

index 6ffbb79c75ffc2717a60ca3679d5ca6449972950..fcf5cbce3e38fcf2ad4cb35e5f15151a2e44c57e 100644 (file)
@@ -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, ':');
index 99b685c452533f5669d8a5a2439739ab2098f280..2acce326450bf643c28ea75eaa09ca4eadb4d1da 100644 (file)
@@ -25,7 +25,7 @@
 /   3: f_lseek() function is removed in addition to 2. */
 
 
-#define        _USE_STRFUNC    0
+#define        _USE_STRFUNC    2
 /* This option switches string functions, f_gets(), f_putc(), f_puts() and
 /  f_printf().
 /
 /  defined by _NORTC_MON, _NORTC_MDAY and _NORTC_YEAR in local time.
 /  To enable timestamp function (_FS_NORTC = 0), get_fattime() function need to be
 /  added to the project to get current time form real-time clock. _NORTC_MON,
-/  _NORTC_MDAY and _NORTC_YEAR have no effect. 
+/  _NORTC_MDAY and _NORTC_YEAR have no effect.
 /  These options have no effect at read-only configuration (_FS_READONLY = 1). */
 
 
index b6a65b0b80aa51404bf7730343d5d3b865594970..3b4a462c7dc60915295a7a633803de0a84c00b60 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef Z180_SERV_H
 #define Z180_SERV_H
 
+#include <stdint.h>
 #include <stdbool.h>
 #include "ff.h"
 
index 4a49907bfdc334b7ab42f64537c930cd71293697..ec22543ce8d595b19607b067cd27c081808fc425 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 4a49907bfdc334b7ab42f64537c930cd71293697
+Subproject commit ec22543ce8d595b19607b067cd27c081808fc425