summaryrefslogtreecommitdiff
path: root/stmhal/file.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-02-06 21:02:34 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-02-07 01:25:28 +0200
commit350ab0f570a2cc570ceb9facb38cbd9ce68057f3 (patch)
tree79fa0793d7c074c65e4c4e48226113788ca31638 /stmhal/file.c
parent103fbaaf27621df4a7389098fc3ac46c5d6513f3 (diff)
stmhal/file: Recast as "FatFs file" class, to support other VFS types.
Move definition of mp_builtin_open_obj to a separate module, then file.c becomes more or less compartmentalized FatFs file class, which can be used together with file class implementations for other (V)FSes.
Diffstat (limited to 'stmhal/file.c')
-rw-r--r--stmhal/file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/stmhal/file.c b/stmhal/file.c
index a61fa050c..b3e811231 100644
--- a/stmhal/file.c
+++ b/stmhal/file.c
@@ -271,10 +271,9 @@ const mp_obj_type_t mp_type_textio = {
};
// Factory function for I/O stream classes
-mp_obj_t mp_builtin_open(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs) {
+mp_obj_t fatfs_builtin_open(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs) {
// TODO: analyze buffering args and instantiate appropriate type
mp_arg_val_t arg_vals[FILE_OPEN_NUM_ARGS];
mp_arg_parse_all(n_args, args, kwargs, FILE_OPEN_NUM_ARGS, file_open_args, arg_vals);
return file_open(&mp_type_textio, arg_vals);
}
-MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);