X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_bufio.c;h=f212da53b36088491f6c91bf1f5d8287d57f9bd6;hb=6b0754cee625c6e2c19dc70fb5be6cd2f0125d47;hp=87de457f96f88539caff1efdc9ef8f00775ed090;hpb=86e1039e14304ac13db540f2ee3afd4ff170b8b4;p=fw%2Faltos diff --git a/src/drivers/ao_bufio.c b/src/drivers/ao_bufio.c index 87de457f..f212da53 100644 --- a/src/drivers/ao_bufio.c +++ b/src/drivers/ao_bufio.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,6 +20,11 @@ #include "ao.h" #endif +/* Include bufio commands */ +#ifndef AO_FAT_TEST +#define BUFIO_COMMANDS 0 +#endif + #include "ao_sdcard.h" #include "ao_bufio.h" @@ -40,7 +46,7 @@ static uint8_t ao_bufio_mutex; #if 0 #define DBG(...) printf(__VA_ARGS__) #else -#define DBG(...) +#define DBG(...) (void) 0 #endif static inline void @@ -268,6 +274,7 @@ ao_bufio_flush(void) ao_bufio_unlock(); } +#if BUFIO_COMMANDS static void ao_bufio_test_read(void) { @@ -290,6 +297,7 @@ static const struct ao_cmds ao_bufio_cmds[] = { { ao_bufio_test_read, "q\0Test bufio read" }, { 0, NULL }, }; +#endif void ao_bufio_setup(void) @@ -308,5 +316,7 @@ ao_bufio_init(void) { ao_bufio_setup(); ao_sdcard_init(); +#if BUFIO_COMMANDS ao_cmd_register(&ao_bufio_cmds[0]); +#endif }