]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
Adaptions for fatfs R0.13b
authorLeo C <erbl259-lmu@yahoo.de>
Sun, 27 May 2018 23:33:27 +0000 (01:33 +0200)
committerLeo C <erbl259-lmu@yahoo.de>
Sun, 27 May 2018 23:33:27 +0000 (01:33 +0200)
avr/Tupfile
avr/cmd_fat.c
avr/cmd_sd.c
include/ff.h

index d41de254de17d8d473aac5151047f96bc5a13d98..05e7e69db6694c25eec355a668283b3c02ab4ac6 100644 (file)
@@ -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
index fcf5cbce3e38fcf2ad4cb35e5f15151a2e44c57e..20d1da9f01e921c26425c65c6d26d0a69746127b 100644 (file)
@@ -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) {
index b84c4be758ec94b0d6797479c92ad56062dd7fc6..91007f994dc10e094e1bebf71fc185e5874c72a8 100644 (file)
@@ -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);
index 7fb6cb17b61dd0505e74be2fb28367b7060cb69b..6dd8d56a2827913b14c6216e23b2f6b0a6de50e5 120000 (symlink)
@@ -1 +1 @@
-../fatfs/src/ff.h
\ No newline at end of file
+../fatfs/source/ff.h
\ No newline at end of file