diff options
Diffstat (limited to 'firmware/test/fat/main.c')
-rw-r--r-- | firmware/test/fat/main.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/firmware/test/fat/main.c b/firmware/test/fat/main.c index 5420199f92..200ea18706 100644 --- a/firmware/test/fat/main.c +++ b/firmware/test/fat/main.c | |||
@@ -9,13 +9,14 @@ | |||
9 | #include "dir.h" | 9 | #include "dir.h" |
10 | #include "file.h" | 10 | #include "file.h" |
11 | 11 | ||
12 | extern int ata_init(char*); | ||
13 | extern void ata_read_sectors(int, int, char*); | ||
14 | |||
15 | void dbg_dump_sector(int sec); | 12 | void dbg_dump_sector(int sec); |
16 | void dbg_dump_buffer(unsigned char *buf, int len, int offset); | 13 | void dbg_dump_buffer(unsigned char *buf, int len, int offset); |
17 | void dbg_console(void); | 14 | void dbg_console(void); |
18 | 15 | ||
16 | void mutex_init(void* l) {} | ||
17 | void mutex_lock(void* l) {} | ||
18 | void mutex_unlock(void* l) {} | ||
19 | |||
19 | void panicf( char *fmt, ...) | 20 | void panicf( char *fmt, ...) |
20 | { | 21 | { |
21 | va_list ap; | 22 | va_list ap; |
@@ -26,6 +27,24 @@ void panicf( char *fmt, ...) | |||
26 | exit(1); | 27 | exit(1); |
27 | } | 28 | } |
28 | 29 | ||
30 | void debugf(const char *fmt, ...) | ||
31 | { | ||
32 | va_list ap; | ||
33 | va_start( ap, fmt ); | ||
34 | fprintf(stderr,"DEBUGF: "); | ||
35 | vfprintf( stderr, fmt, ap ); | ||
36 | va_end( ap ); | ||
37 | } | ||
38 | |||
39 | void ldebugf(const char* file, int line, const char *fmt, ...) | ||
40 | { | ||
41 | va_list ap; | ||
42 | va_start( ap, fmt ); | ||
43 | fprintf( stderr, "%s:%d ", file, line ); | ||
44 | vfprintf( stderr, fmt, ap ); | ||
45 | va_end( ap ); | ||
46 | } | ||
47 | |||
29 | void dbg_dump_sector(int sec) | 48 | void dbg_dump_sector(int sec) |
30 | { | 49 | { |
31 | unsigned char buf[512]; | 50 | unsigned char buf[512]; |
@@ -660,7 +679,7 @@ int main(int argc, char *argv[]) | |||
660 | 679 | ||
661 | srand(clock()); | 680 | srand(clock()); |
662 | 681 | ||
663 | if(ata_init("disk.img")) { | 682 | if(ata_init()) { |
664 | DEBUGF("*** Warning! The disk is uninitialized\n"); | 683 | DEBUGF("*** Warning! The disk is uninitialized\n"); |
665 | return -1; | 684 | return -1; |
666 | } | 685 | } |