X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_fat.c;h=3e9c00b5e32e8f9fa80122d713b19749c9054976;hb=182ceaac7d91dc6e9ebac6455d5de0c10687796b;hp=ea8cdf961f589e58828f066396eaa750e40ffb55;hpb=a0595d94c7deea29d9e3d4bcbc106b9bed5ee103;p=fw%2Faltos diff --git a/src/drivers/ao_fat.c b/src/drivers/ao_fat.c index ea8cdf96..3e9c00b5 100644 --- a/src/drivers/ao_fat.c +++ b/src/drivers/ao_fat.c @@ -23,7 +23,9 @@ #include "ao_bufio.h" /* Include FAT commands */ +#ifndef AO_FAT_TEST #define FAT_COMMANDS 1 +#endif /* Spew FAT tracing */ #define FAT_TRACE 0 @@ -573,7 +575,6 @@ static uint32_t ao_file_offset; 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; @@ -607,6 +608,12 @@ ao_fat_setup(void) return ao_filesystem_status; } +void +ao_fat_unmount(void) +{ + ao_filesystem_setup = 0; +} + /* * Basic file operations */ @@ -1019,7 +1026,6 @@ int 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; @@ -1164,6 +1170,8 @@ ao_fat_readdir(uint16_t *entry, struct ao_fat_dirent *dirent) } } +#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", @@ -1255,6 +1263,8 @@ ao_fat_parse_name(char name[11]) } ao_cmd_lex(); } + while (c < 11) + name[c++] = ' '; } static void @@ -1331,6 +1341,8 @@ static const struct ao_cmds ao_fat_cmds[] = { { 0, NULL }, }; +#endif + void ao_fat_init(void) {