stmhal/file: For self-contained usecase, don't define global types.

If MICROPY_VFS_FAT is defined, mp_type_fileio & mp_type_textio won't be
defined, as these may be alredy defined elsewhere. The idea is to have
compartmentalized VFS FatFs class, which can work in parallel with some
other "main" filesystem. E.g., for unix port, mp_type_fileio, etc. will
be defined for the main POSIX filesystem, while stmhal/file.c will be
a self-contained VFS file class.
This commit is contained in:
Paul Sokolovsky 2016-02-06 21:05:43 +02:00
parent 350ab0f570
commit ab0e36b3da
1 changed files with 5 additions and 0 deletions

View File

@ -33,6 +33,11 @@
#include "lib/fatfs/ff.h"
#include "file.h"
#if MICROPY_VFS_FAT
#define mp_type_fileio fatfs_type_fileio
#define mp_type_textio fatfs_type_textio
#endif
extern const mp_obj_type_t mp_type_fileio;
extern const mp_obj_type_t mp_type_textio;