summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2016-09-10 01:51:36 +0200
committerLeo C2016-09-10 01:51:36 +0200
commit7af9364ebd7ad6c143f31e9abe745c6d75f8322b (patch)
treec7ce8ced4962f807f545814f4279dff9c9d45496
parentb30c4e8f1aef96f6fdc93da9f125545f5f74d06e (diff)
downloadz180-stamp-7af9364ebd7ad6c143f31e9abe745c6d75f8322b.zip
Adaptions for fatfs R0.12b
-rw-r--r--avr/cmd_fat.c34
-rw-r--r--include/avr/ffconf.h4
-rw-r--r--include/z180-serv.h1
m---------libopencm30
4 files changed, 13 insertions, 26 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, ':');
diff --git a/include/avr/ffconf.h b/include/avr/ffconf.h
index 99b685c..2acce32 100644
--- a/include/avr/ffconf.h
+++ b/include/avr/ffconf.h
@@ -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().
/
@@ -225,7 +225,7 @@
/ 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). */
diff --git a/include/z180-serv.h b/include/z180-serv.h
index b6a65b0..3b4a462 100644
--- a/include/z180-serv.h
+++ b/include/z180-serv.h
@@ -7,6 +7,7 @@
#ifndef Z180_SERV_H
#define Z180_SERV_H
+#include <stdint.h>
#include <stdbool.h>
#include "ff.h"
diff --git a/libopencm3 b/libopencm3
-Subproject 4a49907bfdc334b7ab42f64537c930cd7129369
+Subproject ec22543ce8d595b19607b067cd27c081808fc42