From 86e1039e14304ac13db540f2ee3afd4ff170b8b4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 29 Mar 2013 00:32:23 -0700 Subject: altos: Add FAT32 support. And lots more testing. Generalizes the FAT code to deal with either 16-bit or 32-bit versions. The testing code now runs over a variety of disk images to check for compatibility on all of them. Signed-off-by: Keith Packard --- src/drivers/ao_bufio.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/drivers/ao_bufio.c') diff --git a/src/drivers/ao_bufio.c b/src/drivers/ao_bufio.c index 10b32ceb..87de457f 100644 --- a/src/drivers/ao_bufio.c +++ b/src/drivers/ao_bufio.c @@ -22,7 +22,7 @@ #include "ao_sdcard.h" #include "ao_bufio.h" -#define AO_NUM_BUF 4 +#define AO_NUM_BUF 16 #define AO_BUFSIZ 512 struct ao_bufio { @@ -292,13 +292,21 @@ static const struct ao_cmds ao_bufio_cmds[] = { }; void -ao_bufio_init(void) +ao_bufio_setup(void) { int b; - for (b = 0; b < AO_NUM_BUF; b++) + for (b = 0; b < AO_NUM_BUF; b++) { + ao_bufio[b].dirty = 0; + ao_bufio[b].busy = 0; ao_bufio[b].block = 0xffffffff; - ao_sdcard_init(); + } +} +void +ao_bufio_init(void) +{ + ao_bufio_setup(); + ao_sdcard_init(); ao_cmd_register(&ao_bufio_cmds[0]); } -- cgit v1.2.3