summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/cc3200/mpconfigport.h9
-rw-r--r--ports/esp32/mpconfigport.h10
-rw-r--r--ports/esp8266/mpconfigport.h9
-rw-r--r--ports/javascript/mpconfigport.h4
-rw-r--r--ports/mimxrt/mpconfigport.h8
-rw-r--r--ports/minimal/main.c5
-rw-r--r--ports/minimal/mpconfigport.h4
-rw-r--r--ports/nrf/mpconfigport.h7
-rw-r--r--ports/qemu-arm/main.c9
-rw-r--r--ports/qemu-arm/mpconfigport.h4
-rw-r--r--ports/qemu-arm/test_main.c10
-rw-r--r--ports/renesas-ra/mpconfigport.h9
-rw-r--r--ports/rp2/mpconfigport.h9
-rw-r--r--ports/samd/main.c17
-rw-r--r--ports/samd/mpconfigport.h9
-rw-r--r--ports/stm32/mpconfigport.h9
-rw-r--r--ports/unix/mpconfigport.h5
-rw-r--r--ports/unix/variants/minimal/mpconfigvariant.h1
-rw-r--r--ports/windows/mpconfigport.h5
-rw-r--r--ports/zephyr/main.c10
20 files changed, 2 insertions, 151 deletions
diff --git a/ports/cc3200/mpconfigport.h b/ports/cc3200/mpconfigport.h
index a3af89674..58ec80a9f 100644
--- a/ports/cc3200/mpconfigport.h
+++ b/ports/cc3200/mpconfigport.h
@@ -135,15 +135,6 @@
#define mp_type_fileio mp_type_vfs_fat_fileio
#define mp_type_textio mp_type_vfs_fat_textio
-// use vfs's functions for import stat and builtin open
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open mp_vfs_open
-#define mp_builtin_open_obj mp_vfs_open_obj
-
-// extra built in names to add to the global namespace
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) }, \
-
// extra constants
#define MICROPY_PORT_CONSTANTS \
{ MP_ROM_QSTR(MP_QSTR_umachine), MP_ROM_PTR(&mp_module_machine) }, \
diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h
index a64d6de99..6f4241330 100644
--- a/ports/esp32/mpconfigport.h
+++ b/ports/esp32/mpconfigport.h
@@ -126,16 +126,6 @@
#define mp_type_fileio mp_type_vfs_fat_fileio
#define mp_type_textio mp_type_vfs_fat_textio
-// use vfs's functions for import stat and builtin open
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open mp_vfs_open
-#define mp_builtin_open_obj mp_vfs_open_obj
-
-// extra built in names to add to the global namespace
-#define MICROPY_PORT_BUILTINS \
- { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
-
#define MP_STATE_PORT MP_STATE_VM
struct _machine_timer_obj_t;
diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h
index a64bc8f86..583d3648a 100644
--- a/ports/esp8266/mpconfigport.h
+++ b/ports/esp8266/mpconfigport.h
@@ -150,15 +150,6 @@ extern const struct _mp_print_t mp_debug_print;
#define mp_type_textio mp_type_vfs_lfs2_textio
#endif
-// use vfs's functions for import stat and builtin open
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open mp_vfs_open
-#define mp_builtin_open_obj mp_vfs_open_obj
-
-// extra built in names to add to the global namespace
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
-
#define MP_STATE_PORT MP_STATE_VM
#define MICROPY_PORT_ROOT_POINTERS \
diff --git a/ports/javascript/mpconfigport.h b/ports/javascript/mpconfigport.h
index 1d356a0a2..4a6cb4588 100644
--- a/ports/javascript/mpconfigport.h
+++ b/ports/javascript/mpconfigport.h
@@ -175,10 +175,6 @@ typedef int mp_int_t; // must be pointer size
typedef unsigned mp_uint_t; // must be pointer size
typedef long mp_off_t;
-// extra built in names to add to the global namespace
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
-
// We need to provide a declaration/definition of alloca()
#include <alloca.h>
diff --git a/ports/mimxrt/mpconfigport.h b/ports/mimxrt/mpconfigport.h
index 05de0306b..1dcaccad4 100644
--- a/ports/mimxrt/mpconfigport.h
+++ b/ports/mimxrt/mpconfigport.h
@@ -188,11 +188,6 @@ uint32_t trng_random_u32(void);
#define mp_type_fileio mp_type_vfs_lfs2_fileio
#define mp_type_textio mp_type_vfs_lfs2_textio
-// Use VFS's functions for import stat and builtin open
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open mp_vfs_open
-#define mp_builtin_open_obj mp_vfs_open_obj
-
// Hooks to add builtins
__attribute__((always_inline)) static inline void enable_irq(uint32_t state) {
@@ -225,9 +220,6 @@ static inline void restore_irq_pri(uint32_t basepri) {
#define MICROPY_BEGIN_ATOMIC_SECTION() disable_irq()
#define MICROPY_END_ATOMIC_SECTION(state) enable_irq(state)
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
-
#if defined(MICROPY_HW_ETH_MDC)
extern const struct _mp_obj_type_t network_lan_type;
#define MICROPY_HW_NIC_ETH { MP_ROM_QSTR(MP_QSTR_LAN), MP_ROM_PTR(&network_lan_type) },
diff --git a/ports/minimal/main.c b/ports/minimal/main.c
index dbde33915..289327658 100644
--- a/ports/minimal/main.c
+++ b/ports/minimal/main.c
@@ -81,11 +81,6 @@ mp_import_stat_t mp_import_stat(const char *path) {
return MP_IMPORT_STAT_NO_EXIST;
}
-mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs) {
- return mp_const_none;
-}
-MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
-
void nlr_jump_fail(void *val) {
while (1) {
;
diff --git a/ports/minimal/mpconfigport.h b/ports/minimal/mpconfigport.h
index c9f399876..7d6a3aded 100644
--- a/ports/minimal/mpconfigport.h
+++ b/ports/minimal/mpconfigport.h
@@ -25,10 +25,6 @@ typedef intptr_t mp_int_t; // must be pointer size
typedef uintptr_t mp_uint_t; // must be pointer size
typedef long mp_off_t;
-// extra built in names to add to the global namespace
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
-
// We need to provide a declaration/definition of alloca()
#include <alloca.h>
diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h
index 05e35956d..874748c2e 100644
--- a/ports/nrf/mpconfigport.h
+++ b/ports/nrf/mpconfigport.h
@@ -85,13 +85,6 @@
#define mp_type_fileio fatfs_type_fileio
#define mp_type_textio fatfs_type_textio
-// use vfs's functions for import stat and builtin open
-#if MICROPY_VFS
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open mp_vfs_open
-#define mp_builtin_open_obj mp_vfs_open_obj
-#endif
-
// Enable micro:bit filesystem by default.
#ifndef MICROPY_MBFS
#define MICROPY_MBFS (1)
diff --git a/ports/qemu-arm/main.c b/ports/qemu-arm/main.c
index 8c49d0c78..45da65f2a 100644
--- a/ports/qemu-arm/main.c
+++ b/ports/qemu-arm/main.c
@@ -45,15 +45,6 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
mp_raise_OSError(MP_ENOENT);
}
-mp_import_stat_t mp_import_stat(const char *path) {
- return MP_IMPORT_STAT_NO_EXIST;
-}
-
-mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs) {
- return mp_const_none;
-}
-MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
-
void nlr_jump_fail(void *val) {
printf("uncaught NLR\n");
exit(1);
diff --git a/ports/qemu-arm/mpconfigport.h b/ports/qemu-arm/mpconfigport.h
index 879ad7eaa..8809d1715 100644
--- a/ports/qemu-arm/mpconfigport.h
+++ b/ports/qemu-arm/mpconfigport.h
@@ -61,10 +61,6 @@ typedef int32_t mp_int_t; // must be pointer size
typedef uint32_t mp_uint_t; // must be pointer size
typedef long mp_off_t;
-// extra built in names to add to the global namespace
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
-
// We need to provide a declaration/definition of alloca()
#include <alloca.h>
diff --git a/ports/qemu-arm/test_main.c b/ports/qemu-arm/test_main.c
index 3a89b3f13..673311d1e 100644
--- a/ports/qemu-arm/test_main.c
+++ b/ports/qemu-arm/test_main.c
@@ -5,7 +5,6 @@
#include <malloc.h>
#include <setjmp.h>
-#include "py/builtin.h"
#include "py/compile.h"
#include "py/runtime.h"
#include "py/stackctrl.h"
@@ -39,15 +38,6 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
mp_raise_OSError(MP_ENOENT);
}
-mp_import_stat_t mp_import_stat(const char *path) {
- return MP_IMPORT_STAT_NO_EXIST;
-}
-
-mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs) {
- return mp_const_none;
-}
-MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
-
void nlr_jump_fail(void *val) {
printf("uncaught NLR\n");
exit(1);
diff --git a/ports/renesas-ra/mpconfigport.h b/ports/renesas-ra/mpconfigport.h
index e66ca6b18..02292a118 100644
--- a/ports/renesas-ra/mpconfigport.h
+++ b/ports/renesas-ra/mpconfigport.h
@@ -149,15 +149,6 @@
#define mp_type_textio mp_type_vfs_lfs2_textio
#endif
-// use vfs's functions for import stat and builtin open
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open mp_vfs_open
-#define mp_builtin_open_obj mp_vfs_open_obj
-
-// extra built in names to add to the global namespace
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
-
#if MICROPY_PY_MACHINE
#define MACHINE_BUILTIN_MODULE_CONSTANTS \
{ MP_ROM_QSTR(MP_QSTR_umachine), MP_ROM_PTR(&mp_module_machine) }, \
diff --git a/ports/rp2/mpconfigport.h b/ports/rp2/mpconfigport.h
index 704247dfb..f71ddce7c 100644
--- a/ports/rp2/mpconfigport.h
+++ b/ports/rp2/mpconfigport.h
@@ -125,15 +125,6 @@
#define mp_type_textio mp_type_vfs_lfs2_textio
#endif
-// Use VFS's functions for import stat and builtin open
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open_obj mp_vfs_open_obj
-
-// Hooks to add builtins
-
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
-
#if MICROPY_PY_NETWORK
#define NETWORK_ROOT_POINTERS mp_obj_list_t mod_network_nic_list;
#else
diff --git a/ports/samd/main.c b/ports/samd/main.c
index 63fe4013a..d8c1c596c 100644
--- a/ports/samd/main.c
+++ b/ports/samd/main.c
@@ -73,23 +73,6 @@ void gc_collect(void) {
gc_collect_end();
}
-/*
-mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
- mp_raise_OSError(MP_ENOENT);
-}
-*/
-
-#if !MICROPY_VFS
-mp_import_stat_t mp_import_stat(const char *path) {
- return MP_IMPORT_STAT_NO_EXIST;
-}
-
-mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs) {
- return mp_const_none;
-}
-MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
-#endif
-
void nlr_jump_fail(void *val) {
for (;;) {
}
diff --git a/ports/samd/mpconfigport.h b/ports/samd/mpconfigport.h
index 613b8cd5a..1625496a2 100644
--- a/ports/samd/mpconfigport.h
+++ b/ports/samd/mpconfigport.h
@@ -99,15 +99,6 @@
#define mp_type_fileio mp_type_vfs_lfs1_fileio
#define mp_type_textio mp_type_vfs_lfs1_textio
-// Use VFS's functions for import stat and builtin open
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open_obj mp_vfs_open_obj
-
-// Hooks to add builtins
-
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
-
#define MICROPY_PORT_ROOT_POINTERS \
const char *readline_hist[8];
diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h
index 484dd842c..00b60b983 100644
--- a/ports/stm32/mpconfigport.h
+++ b/ports/stm32/mpconfigport.h
@@ -163,15 +163,6 @@
#define mp_type_textio mp_type_vfs_lfs2_textio
#endif
-// use vfs's functions for import stat and builtin open
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open mp_vfs_open
-#define mp_builtin_open_obj mp_vfs_open_obj
-
-// extra built in names to add to the global namespace
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
-
#if MICROPY_PY_PYB
extern const struct _mp_obj_module_t pyb_module;
#define PYB_BUILTIN_MODULE_CONSTANTS \
diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h
index 524b16523..ca050b414 100644
--- a/ports/unix/mpconfigport.h
+++ b/ports/unix/mpconfigport.h
@@ -214,8 +214,6 @@ extern const struct _mp_print_t mp_stderr_print;
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (256)
#define MICROPY_ASYNC_KBD_INTR (1)
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open_obj mp_vfs_open_obj
#define mp_type_fileio mp_type_vfs_posix_fileio
#define mp_type_textio mp_type_vfs_posix_textio
@@ -273,9 +271,6 @@ void mp_unix_mark_exec(void);
#endif
#endif
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
-
#define MP_STATE_PORT MP_STATE_VM
#if MICROPY_PY_BLUETOOTH
diff --git a/ports/unix/variants/minimal/mpconfigvariant.h b/ports/unix/variants/minimal/mpconfigvariant.h
index f6be44692..60d194b6a 100644
--- a/ports/unix/variants/minimal/mpconfigvariant.h
+++ b/ports/unix/variants/minimal/mpconfigvariant.h
@@ -109,7 +109,6 @@
#define MICROPY_PORT_ROOT_POINTERS \
-#define mp_import_stat mp_vfs_import_stat
#define mp_type_fileio mp_type_vfs_posix_fileio
#define mp_type_textio mp_type_vfs_posix_textio
diff --git a/ports/windows/mpconfigport.h b/ports/windows/mpconfigport.h
index ecaa520e8..47292b3bb 100644
--- a/ports/windows/mpconfigport.h
+++ b/ports/windows/mpconfigport.h
@@ -171,8 +171,6 @@ extern const struct _mp_print_t mp_stderr_print;
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (256)
#define MICROPY_KBD_EXCEPTION (1)
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open_obj mp_vfs_open_obj
#define mp_type_fileio mp_type_vfs_posix_fileio
#define mp_type_textio mp_type_vfs_posix_textio
@@ -212,9 +210,6 @@ typedef long long mp_off_t;
typedef long mp_off_t;
#endif
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
-
#if MICROPY_USE_READLINE == 1
#define MICROPY_PORT_ROOT_POINTERS \
char *readline_hist[50];
diff --git a/ports/zephyr/main.c b/ports/zephyr/main.c
index ed1ac560e..4f735b671 100644
--- a/ports/zephyr/main.c
+++ b/ports/zephyr/main.c
@@ -195,22 +195,16 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
}
#endif
+#if !MICROPY_VFS
mp_import_stat_t mp_import_stat(const char *path) {
- #if MICROPY_VFS
- return mp_vfs_import_stat(path);
- #else
return MP_IMPORT_STAT_NO_EXIST;
- #endif
}
mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs) {
- #if MICROPY_VFS
- return mp_vfs_open(n_args, args, kwargs);
- #else
return mp_const_none;
- #endif
}
MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
+#endif
NORETURN void nlr_jump_fail(void *val) {
while (1) {