summaryrefslogtreecommitdiff
path: root/src/drivers/ao_bufio.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-03-29 00:32:23 -0700
committerKeith Packard <keithp@keithp.com>2013-03-29 00:32:23 -0700
commit86e1039e14304ac13db540f2ee3afd4ff170b8b4 (patch)
treee80fbbcaf528cf657cbab0a50a7b298cdfabfac0 /src/drivers/ao_bufio.c
parent44e418bbecd3a3deae942803141cf115d92f29d2 (diff)
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 <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_bufio.c')
-rw-r--r--src/drivers/ao_bufio.c16
1 files changed, 12 insertions, 4 deletions
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]);
}