diff options
Diffstat (limited to 'firmware/test/fat/main.c')
-rw-r--r-- | firmware/test/fat/main.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/firmware/test/fat/main.c b/firmware/test/fat/main.c index fcd2dcc5eb..4a11e0a08a 100644 --- a/firmware/test/fat/main.c +++ b/firmware/test/fat/main.c | |||
@@ -61,7 +61,8 @@ void dbg_dir(char* currdir) | |||
61 | if (dir) | 61 | if (dir) |
62 | { | 62 | { |
63 | while ( (entry = readdir(dir)) ) { | 63 | while ( (entry = readdir(dir)) ) { |
64 | DEBUGF("%15s (%d bytes)\n", entry->d_name, entry->size); | 64 | DEBUGF("%15s (%d bytes) %x\n", |
65 | entry->d_name, entry->size, entry->startcluster); | ||
65 | } | 66 | } |
66 | closedir(dir); | 67 | closedir(dir); |
67 | } | 68 | } |
@@ -71,6 +72,20 @@ void dbg_dir(char* currdir) | |||
71 | } | 72 | } |
72 | } | 73 | } |
73 | 74 | ||
75 | void dbg_mkfile(char* name) | ||
76 | { | ||
77 | char* text = "Detta är en dummy-text\n"; | ||
78 | int fd = open(name,O_WRONLY); | ||
79 | if (fd<0) { | ||
80 | DEBUGF("Failed creating file\n"); | ||
81 | return; | ||
82 | } | ||
83 | if (write(fd, text, strlen(text)) < 0) | ||
84 | DEBUGF("Failed writing data\n"); | ||
85 | |||
86 | close(fd); | ||
87 | } | ||
88 | |||
74 | void dbg_type(char* name) | 89 | void dbg_type(char* name) |
75 | { | 90 | { |
76 | unsigned char buf[SECTOR_SIZE*5]; | 91 | unsigned char buf[SECTOR_SIZE*5]; |
@@ -270,6 +285,8 @@ int main(int argc, char *argv[]) | |||
270 | 285 | ||
271 | //dbg_console(); | 286 | //dbg_console(); |
272 | //dbg_tail("/fat.h"); | 287 | //dbg_tail("/fat.h"); |
288 | //dbg_dir("/"); | ||
289 | dbg_mkfile("/apa.txt"); | ||
273 | dbg_dir("/"); | 290 | dbg_dir("/"); |
274 | 291 | ||
275 | return 0; | 292 | return 0; |