summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2018-05-28 01:33:27 +0200
committerLeo C2018-05-28 01:33:27 +0200
commitd20e9438cec2ce6d495ff4168da6852cf58c6964 (patch)
tree047ecb4a826f91700ca3c378d6556569e681870d
parent0f3b947bda5f34662a611272b9f12199e0da9aca (diff)
downloadz180-stamp-d20e9438cec2ce6d495ff4168da6852cf58c6964.zip
Adaptions for fatfs R0.13b
-rw-r--r--avr/Tupfile5
-rw-r--r--avr/cmd_fat.c2
-rw-r--r--avr/cmd_sd.c16
l---------include/ff.h2
4 files changed, 13 insertions, 12 deletions
diff --git a/avr/Tupfile b/avr/Tupfile
index d41de25..05e7e69 100644
--- a/avr/Tupfile
+++ b/avr/Tupfile
@@ -2,7 +2,8 @@ include_rules
PROG = stamp-monitor
-FATFS = $(TOP)/fatfs/src/ff.c
+FATFSD = $(TOP)/fatfs/source
+FATFS = $(FATFSD)/ff.c $(FATFSD)/ffunicode.c
SRC = main.c
SRC += cli.c cli_readline.c command.c command_tbl.c
@@ -13,7 +14,7 @@ SRC += env.c xmalloc.c con-utils.c print-utils.c
SRC += getopt-min.c eval_arg.c
SRC += timer.c serial.c i2c.c bcd.c pcf8583.c mmc.c
SRC += background.c z180-serv.c z80-if.c gpio.c
-SRC += $(FATFS) $(TOP)/fatfs/src/option/unicode.c
+SRC += $(FATFS)
#TODO: time lib
SRC += ../time/asctime_r.c ../time/gmtime_r.c ../time/mk_gmtime.c
diff --git a/avr/cmd_fat.c b/avr/cmd_fat.c
index fcf5cbc..20d1da9 100644
--- a/avr/cmd_fat.c
+++ b/avr/cmd_fat.c
@@ -124,7 +124,7 @@ FRESULT scan_files (
i = strlen(path);
while (((res = f_readdir(&dirs, &statp->Finfo)) == FR_OK) &&
statp->Finfo.fname[0]) {
- if (_FS_RPATH && statp->Finfo.fname[0] == '.')
+ if (FF_FS_RPATH && statp->Finfo.fname[0] == '.')
continue;
fn = statp->Finfo.fname;
if (statp->Finfo.fattrib & AM_DIR) {
diff --git a/avr/cmd_sd.c b/avr/cmd_sd.c
index b84c4be..91007f9 100644
--- a/avr/cmd_sd.c
+++ b/avr/cmd_sd.c
@@ -126,7 +126,7 @@ command_ret_t do_dump(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
static BYTE dev_last;
static DWORD sec_last;
- BYTE buffer[_MAX_SS];
+ BYTE buffer[FF_MAX_SS];
char header[20];
DRESULT res;
@@ -162,7 +162,7 @@ command_ret_t do_dump(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
sprintf_P(header, PSTR("Sector: %lu"), sec);
- dump_ram(buffer, 0, _MAX_SS, header);
+ dump_ram(buffer, 0, FF_MAX_SS, header);
}
dev_last = dev;
sec_last = sec;
@@ -182,7 +182,7 @@ command_ret_t do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
DWORD sec;
uint32_t addr;
int count, nr;
- BYTE buffer[_MAX_SS];
+ BYTE buffer[FF_MAX_SS];
static DWORD sec_last;
static uint32_t addr_last;
@@ -214,9 +214,9 @@ command_ret_t do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
my_puts_P(PSTR("Bus timeout\n"));
return CMD_RET_FAILURE;
}
- z80_write_block(buffer, addr /*+ base*/, _MAX_SS);
+ z80_write_block(buffer, addr /*+ base*/, FF_MAX_SS);
z80_bus_cmd(Release);
- sec++; addr += _MAX_SS;
+ sec++; addr += FF_MAX_SS;
} else
break;
}
@@ -244,7 +244,7 @@ command_ret_t do_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
DWORD sec;
uint32_t addr;
int count, nr;
- BYTE buffer[_MAX_SS];
+ BYTE buffer[FF_MAX_SS];
static DWORD sec_last;
static uint32_t addr_last;
@@ -275,13 +275,13 @@ command_ret_t do_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
my_puts_P(PSTR("Bus timeout\n"));
return CMD_RET_FAILURE;
}
- z80_read_block(buffer, addr /*+ base*/, _MAX_SS);
+ z80_read_block(buffer, addr /*+ base*/, FF_MAX_SS);
z80_bus_cmd(Release);
res = disk_write(dev, buffer, sec, 1);
if (res != RES_OK)
break;
- sec++; addr += _MAX_SS;
+ sec++; addr += FF_MAX_SS;
}
printf_P(PSTR("%d sector(s) written, rc=%.2x.\n"), nr, res);
diff --git a/include/ff.h b/include/ff.h
index 7fb6cb1..6dd8d56 120000
--- a/include/ff.h
+++ b/include/ff.h
@@ -1 +1 @@
-../fatfs/src/ff.h \ No newline at end of file
+../fatfs/source/ff.h \ No newline at end of file