]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
fat cp: reorg
authorLeo C <leo@lenti.loc>
Tue, 17 Apr 2018 09:43:03 +0000 (11:43 +0200)
committerLeo C <leo@lenti.loc>
Tue, 17 Apr 2018 09:43:03 +0000 (11:43 +0200)
.gitignore
avr/cmd_fat.c

index c2675365965858acce0072cdfb0c163904439233..55e046a64d44f98e1e999d78cf4406d1270917b3 100644 (file)
@@ -4,3 +4,5 @@
 /.tup
 /build-*
 /scratch
+*.o
+
index 8acbf8af173052df64a58fd84ebbd08b920b19e6..f6e1bcceb1183661ce8035a48a39fbce563154c0 100644 (file)
 /* TODO: detect_ramsize() should be moved to z80-if.c */
 #define MAX_MEMORY     CONFIG_SYS_RAMSIZE_MAX
 #define BUFFER_SIZE    512
+#define MAX_PATHLEN CONFIG_SYS_MAX_PATHLEN
 
 
+typedef struct {
+       char *p_end;                    /* pointer to NULL at end of path */
+       char p_path[MAX_PATHLEN + 1];   /* pointer to the start of a path */
+} PATH_T;
+
 /*
  * Multible (fat) partitions per physical drive are not supported,
  * but we have up to 2 sdcard slots.
 FATFS FatFs0;
 FATFS FatFs1;
 
+uint8_t *blockbuf;
+int blockbuf_size;
+PATH_T from;
+PATH_T to;
 command_ret_t command_ret;
 
 void setup_fatfs(void)
@@ -233,7 +243,6 @@ command_ret_t do_cd(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc,
        return CMD_RET_SUCCESS;
 }
 
-#define MAX_PATHLEN CONFIG_SYS_MAX_PATHLEN
 
 /*
  * Remove trailing slashes,
@@ -438,11 +447,6 @@ FRESULT mkpath(TCHAR *path)
  */
 
 
-typedef struct {
-       char *p_end;                    /* pointer to NULL at end of path */
-       char p_path[MAX_PATHLEN + 1];   /* pointer to the start of a path */
-} PATH_T;
-
 static void strip_trailing_slash(PATH_T *p)
 {
        char *beg = p->p_path;
@@ -540,13 +544,6 @@ char *path_basename(PATH_T *p)
 
 
 static uint8_t flags;
-PATH_T from;
-PATH_T to;
-//PATH_T *from = &from_static;
-//PATH_T *to = &to_static;
-static uint8_t *blockbuf;
-static int blockbuf_size;
-
 #define F_FLAG (1<<3)  // overwrite existing file ignoring write protection
 #define I_FLAG (1<<1)  // prompt before overwrite (overrides a previous -n option)
 #define N_FLAG (1<<2)  // do not overwrite an existing file (overrides a previous -i option)