From 1105e38414fff26d6b1e278ee3bf19b9b981299c Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 15 Aug 2014 00:31:32 +1000 Subject: Separate GFILE into separate source files to prevent future name and include file conflicts. --- src/gfile/inc_chibiosfs.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/gfile/inc_chibiosfs.c') diff --git a/src/gfile/inc_chibiosfs.c b/src/gfile/inc_chibiosfs.c index 13ae6cac..72826e28 100644 --- a/src/gfile/inc_chibiosfs.c +++ b/src/gfile/inc_chibiosfs.c @@ -5,14 +5,16 @@ * http://ugfx.org/license.html */ -/** - * This file is included by src/gfile/gfile.c - */ - /******************************************************** - * The ChibiOS BaseFileStream file-system VMT + * The ChibiOS BaseFileStream file-system ********************************************************/ +#include "gfx.h" + +#if GFX_USE_GFILE && GFILE_NEED_CHIBIOSFS && GFX_USE_OS_CHIBIOS + +#include "gfile_fs.h" + static void ChibiOSBFSClose(GFILE *f); static int ChibiOSBFSRead(GFILE *f, void *buf, int size); static int ChibiOSBFSWrite(GFILE *f, const void *buf, int size); @@ -21,7 +23,6 @@ static long int ChibiOSBFSGetsize(GFILE *f); static bool_t ChibiOSBFSEof(GFILE *f); static const GFILEVMT FsCHIBIOSVMT = { - 0, // next GFSFLG_SEEKABLE|GFSFLG_WRITEABLE, // flags 0, // prefix 0, 0, 0, 0, @@ -53,7 +54,7 @@ GFILE * gfileOpenBaseFileStream(void *BaseFileStreamPtr, const char *mode) { GFILE * f; // Get an empty file and set the flags - if (!(f = findemptyfile(mode))) + if (!(f = _gfileFindSlot(mode))) return 0; // File is open - fill in all the details @@ -63,3 +64,5 @@ GFILE * gfileOpenBaseFileStream(void *BaseFileStreamPtr, const char *mode) { f->flags |= GFILEFLG_OPEN|GFILEFLG_CANSEEK; return f; } + +#endif //GFX_USE_GFILE && GFILE_NEED_CHIBIOSFS && GFX_USE_OS_CHIBIOS -- cgit v1.2.3