From 58b9789d0c824c665db744ef3653d6304e908bc0 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 21 Apr 2017 14:43:03 -0700 Subject: atmel-samd: Introduce audio sample playback via audioio.AudioOut. --- extmod/vfs_fat_file.c | 17 ++--------------- extmod/vfs_fat_file.h | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 15 deletions(-) (limited to 'extmod') diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index 77848b5a5..ef57225a9 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -24,7 +24,8 @@ * THE SOFTWARE. */ -#include "py/mpconfig.h" +#include "extmod/vfs_fat_file.h" + // *_ADHOC part is for cc3200 port which doesn't use general uPy // infrastructure and instead duplicates code. TODO: Resolve. #if MICROPY_FSUSERMOUNT || MICROPY_FSUSERMOUNT_ADHOC @@ -37,15 +38,6 @@ #include "py/stream.h" #include "py/mperrno.h" #include "lib/fatfs/ff.h" -#include "extmod/vfs_fat_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; // this table converts from FRESULT to POSIX errno const byte fresult_to_errno_table[20] = { @@ -71,11 +63,6 @@ const byte fresult_to_errno_table[20] = { [FR_INVALID_PARAMETER] = MP_EINVAL, }; -typedef struct _pyb_file_obj_t { - mp_obj_base_t base; - FIL fp; -} pyb_file_obj_t; - STATIC void file_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { (void)kind; mp_printf(print, "", mp_obj_get_type_str(self_in), MP_OBJ_TO_PTR(self_in)); diff --git a/extmod/vfs_fat_file.h b/extmod/vfs_fat_file.h index 5c271b6ee..5dc627986 100644 --- a/extmod/vfs_fat_file.h +++ b/extmod/vfs_fat_file.h @@ -24,9 +24,35 @@ * THE SOFTWARE. */ +#ifndef __MICROPY_INCLUDED_EXTMOD_VFS_FAT_FILE_H__ +#define __MICROPY_INCLUDED_EXTMOD_VFS_FAT_FILE_H__ + +#include "lib/fatfs/ff.h" +#include "py/mpconfig.h" +#include "py/obj.h" + +#if MICROPY_FSUSERMOUNT || MICROPY_FSUSERMOUNT_ADHOC + extern const byte fresult_to_errno_table[20]; +#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; + +typedef struct _pyb_file_obj_t { + mp_obj_base_t base; + FIL fp; +} pyb_file_obj_t; + mp_obj_t fatfs_builtin_open(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs); MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj); mp_obj_t fat_vfs_listdir(const char *path, bool is_str_type); + +#endif // MICROPY_FSUSERMOUNT || MICROPY_FSUSERMOUNT_ADHOC + +#endif // __MICROPY_INCLUDED_EXTMOD_VFS_FAT_FILE_H__ -- cgit v1.2.3