#include "ao_bufio.h"
/* Include FAT commands */
+#ifndef AO_FAT_TEST
#define FAT_COMMANDS 1
+#endif
/* Spew FAT tracing */
#define FAT_TRACE 0
static uint32_t ao_file_cluster_offset;
static cluster_t ao_file_cluster;
static uint8_t ao_file_opened;
-static uint8_t ao_filesystem_available;
static uint8_t ao_filesystem_setup;
static uint8_t ao_filesystem_status;
return ao_filesystem_status;
}
+void
+ao_fat_unmount(void)
+{
+ ao_filesystem_setup = 0;
+}
+
/*
* Basic file operations
*/
ao_fat_write(void *src, int len)
{
uint8_t *src_b = src;
- uint32_t sector;
uint16_t this_time;
uint16_t offset;
uint8_t *buf;
}
}
+#if FAT_COMMANDS
+
static const char *filesystem_errors[] = {
[AO_FAT_FILESYSTEM_SUCCESS] = "FAT file system operating normally",
[AO_FAT_FILESYSTEM_MBR_READ_FAILURE] = "MBR media read error",
}
ao_cmd_lex();
}
+ while (c < 11)
+ name[c++] = ' ';
}
static void
{ 0, NULL },
};
+#endif
+
void
ao_fat_init(void)
{