diff --git a/bare-arm/mpconfigport.h b/bare-arm/mpconfigport.h index 4b54fa411b..54e1171fdd 100644 --- a/bare-arm/mpconfigport.h +++ b/bare-arm/mpconfigport.h @@ -2,14 +2,15 @@ // options to control how Micro Python is built +#define MICROPY_ALLOC_PATH_MAX (512) #define MICROPY_EMIT_X64 (0) #define MICROPY_EMIT_THUMB (0) #define MICROPY_EMIT_INLINE_THUMB (0) #define MICROPY_MEM_STATS (0) #define MICROPY_DEBUG_PRINTERS (0) #define MICROPY_ENABLE_GC (0) -#define MICROPY_ENABLE_REPL_HELPERS (0) -#define MICROPY_ENABLE_LEXER_UNIX (0) +#define MICROPY_HELPER_REPL (0) +#define MICROPY_HELPER_LEXER_UNIX (0) #define MICROPY_ENABLE_SOURCE_LINE (0) #define MICROPY_ENABLE_MOD_COLLECTIONS (0) #define MICROPY_ENABLE_MOD_MATH (0) @@ -21,7 +22,6 @@ #define MICROPY_CPYTHON_COMPAT (0) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE) -#define MICROPY_PATH_MAX (512) // type definitions for the specific machine @@ -37,6 +37,6 @@ typedef const void *machine_const_ptr_t; // must be of pointer size // extra built in names to add to the global namespace extern const struct _mp_obj_fun_native_t mp_builtin_open_obj; -#define MICROPY_EXTRA_BUILTINS \ +#define MICROPY_PORT_BUILTINS \ { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, diff --git a/py/builtinimport.c b/py/builtinimport.c index e758158a64..d2b18701b4 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -278,7 +278,7 @@ mp_obj_t mp_builtin___import__(uint n_args, mp_obj_t *args) { DEBUG_printf("Module not yet loaded\n"); uint last = 0; - VSTR_FIXED(path, MICROPY_PATH_MAX) + VSTR_FIXED(path, MICROPY_ALLOC_PATH_MAX) module_obj = MP_OBJ_NULL; mp_obj_t top_module_obj = MP_OBJ_NULL; mp_obj_t outer_module_obj = MP_OBJ_NULL; diff --git a/py/builtintables.c b/py/builtintables.c index 133c14a269..d51c0198b2 100644 --- a/py/builtintables.c +++ b/py/builtintables.c @@ -140,7 +140,7 @@ STATIC const mp_map_elem_t mp_builtin_object_table[] = { // TODO: For MICROPY_CPYTHON_COMPAT==0 use ValueError to avoid exc proliferation // Extra builtins as defined by a port - MICROPY_EXTRA_BUILTINS + MICROPY_PORT_BUILTINS }; const mp_obj_dict_t mp_builtin_object_dict_obj = { @@ -183,7 +183,7 @@ STATIC const mp_map_elem_t mp_builtin_module_table[] = { #endif // extra builtin modules as defined by a port - MICROPY_EXTRA_BUILTIN_MODULES + MICROPY_PORT_BUILTIN_MODULES }; const mp_obj_dict_t mp_builtin_module_dict_obj = { diff --git a/py/compile.c b/py/compile.c index cdd3a5b030..0c43d939e1 100644 --- a/py/compile.c +++ b/py/compile.c @@ -104,7 +104,7 @@ STATIC void compile_syntax_error(compiler_t *comp, mp_parse_node_t pn, const cha STATIC const mp_map_elem_t mp_constants_table[] = { // Extra constants as defined by a port - MICROPY_EXTRA_CONSTANTS + MICROPY_PORT_CONSTANTS }; STATIC const mp_map_t mp_constants_map = { @@ -119,7 +119,7 @@ STATIC const mp_map_t mp_constants_map = { STATIC mp_parse_node_t fold_constants(compiler_t *comp, mp_parse_node_t pn, mp_map_t *consts) { if (0) { // dummy -#if MICROPY_ENABLE_CONST +#if MICROPY_COMP_CONST } else if (MP_PARSE_NODE_IS_ID(pn)) { // lookup identifier in table of dynamic constants qstr qst = MP_PARSE_NODE_LEAF_ARG(pn); @@ -133,7 +133,7 @@ STATIC mp_parse_node_t fold_constants(compiler_t *comp, mp_parse_node_t pn, mp_m // fold some parse nodes before folding their arguments switch (MP_PARSE_NODE_STRUCT_KIND(pns)) { -#if MICROPY_ENABLE_CONST +#if MICROPY_COMP_CONST case PN_expr_stmt: if (!MP_PARSE_NODE_IS_NULL(pns->nodes[1])) { mp_parse_node_struct_t *pns1 = (mp_parse_node_struct_t*)pns->nodes[1]; diff --git a/py/lexer.c b/py/lexer.c index e2dfea78c8..42f755ed98 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -218,8 +218,8 @@ STATIC void next_char(mp_lexer_t *lex) { void indent_push(mp_lexer_t *lex, uint indent) { if (lex->num_indent_level >= lex->alloc_indent_level) { // TODO use m_renew_maybe and somehow indicate an error if it fails... probably by using MP_TOKEN_MEMORY_ERROR - lex->indent_level = m_renew(uint16_t, lex->indent_level, lex->alloc_indent_level, lex->alloc_indent_level + MP_ALLOC_LEXEL_INDENT_INC); - lex->alloc_indent_level += MP_ALLOC_LEXEL_INDENT_INC; + lex->indent_level = m_renew(uint16_t, lex->indent_level, lex->alloc_indent_level, lex->alloc_indent_level + MICROPY_ALLOC_LEXEL_INDENT_INC); + lex->alloc_indent_level += MICROPY_ALLOC_LEXEL_INDENT_INC; } lex->indent_level[lex->num_indent_level++] = indent; } @@ -731,7 +731,7 @@ mp_lexer_t *mp_lexer_new(qstr src_name, void *stream_data, mp_lexer_stream_next_ lex->column = 1; lex->emit_dent = 0; lex->nested_bracket_level = 0; - lex->alloc_indent_level = MP_ALLOC_LEXER_INDENT_INIT; + lex->alloc_indent_level = MICROPY_ALLOC_LEXER_INDENT_INIT; lex->num_indent_level = 1; lex->indent_level = m_new_maybe(uint16_t, lex->alloc_indent_level); vstr_init(&lex->vstr, 32); diff --git a/py/lexerunix.c b/py/lexerunix.c index 4631cacaf7..89dc80b004 100644 --- a/py/lexerunix.c +++ b/py/lexerunix.c @@ -27,7 +27,7 @@ #include "misc.h" #include "mpconfig.h" -#if MICROPY_ENABLE_LEXER_UNIX +#if MICROPY_HELPER_LEXER_UNIX #include #include @@ -81,4 +81,4 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename) { return mp_lexer_new(qstr_from_str(filename), fb, (mp_lexer_stream_next_char_t)file_buf_next_char, (mp_lexer_stream_close_t)file_buf_close); } -#endif // MICROPY_ENABLE_LEXER_UNIX +#endif // MICROPY_HELPER_LEXER_UNIX diff --git a/py/mpconfig.h b/py/mpconfig.h index 445fc78b04..5104f39721 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -37,43 +37,49 @@ /* Memory allocation policy */ // Initial amount for lexer indentation level -#ifndef MP_ALLOC_LEXER_INDENT_INIT -#define MP_ALLOC_LEXER_INDENT_INIT (10) +#ifndef MICROPY_ALLOC_LEXER_INDENT_INIT +#define MICROPY_ALLOC_LEXER_INDENT_INIT (10) #endif // Increment for lexer indentation level -#ifndef MP_ALLOC_LEXEL_INDENT_INC -#define MP_ALLOC_LEXEL_INDENT_INC (8) +#ifndef MICROPY_ALLOC_LEXEL_INDENT_INC +#define MICROPY_ALLOC_LEXEL_INDENT_INC (8) #endif // Initial amount for parse rule stack -#ifndef MP_ALLOC_PARSE_RULE_INIT -#define MP_ALLOC_PARSE_RULE_INIT (64) +#ifndef MICROPY_ALLOC_PARSE_RULE_INIT +#define MICROPY_ALLOC_PARSE_RULE_INIT (64) #endif // Increment for parse rule stack -#ifndef MP_ALLOC_PARSE_RULE_INC -#define MP_ALLOC_PARSE_RULE_INC (16) +#ifndef MICROPY_ALLOC_PARSE_RULE_INC +#define MICROPY_ALLOC_PARSE_RULE_INC (16) #endif // Initial amount for parse result stack -#ifndef MP_ALLOC_PARSE_RESULT_INIT -#define MP_ALLOC_PARSE_RESULT_INIT (32) +#ifndef MICROPY_ALLOC_PARSE_RESULT_INIT +#define MICROPY_ALLOC_PARSE_RESULT_INIT (32) #endif // Increment for parse result stack -#ifndef MP_ALLOC_PARSE_RESULT_INC -#define MP_ALLOC_PARSE_RESULT_INC (16) +#ifndef MICROPY_ALLOC_PARSE_RESULT_INC +#define MICROPY_ALLOC_PARSE_RESULT_INC (16) #endif // Initial amount for ids in a scope -#ifndef MP_ALLOC_SCOPE_ID_INIT -#define MP_ALLOC_SCOPE_ID_INIT (4) +#ifndef MICROPY_ALLOC_SCOPE_ID_INIT +#define MICROPY_ALLOC_SCOPE_ID_INIT (4) #endif // Increment for ids in a scope -#ifndef MP_ALLOC_SCOPE_ID_INC -#define MP_ALLOC_SCOPE_ID_INC (6) +#ifndef MICROPY_ALLOC_SCOPE_ID_INC +#define MICROPY_ALLOC_SCOPE_ID_INC (6) +#endif + +// Maximum length of a path in the filesystem +// So we can allocate a buffer on the stack for path manipulation in import +#ifndef MICROPY_ALLOC_PATH_MAX +#define MICROPY_ALLOC_PATH_MAX (512) #endif /*****************************************************************************/ @@ -100,6 +106,14 @@ #define MICROPY_EMIT_INLINE_THUMB (0) #endif +/*****************************************************************************/ +/* Compiler configuration */ + +// Whether to enable constant optimisation; id = const(value) +#ifndef MICROPY_COMP_CONST +#define MICROPY_COMP_CONST (1) +#endif + /*****************************************************************************/ /* Internal debugging stuff */ @@ -119,11 +133,6 @@ /*****************************************************************************/ /* Fine control over Python features */ -// Whether to enable constant optimisation; id = const(value) -#ifndef MICROPY_ENABLE_CONST -#define MICROPY_ENABLE_CONST (1) -#endif - // Whether to include the garbage collector #ifndef MICROPY_ENABLE_GC #define MICROPY_ENABLE_GC (0) @@ -135,13 +144,13 @@ #endif // Whether to include REPL helper function -#ifndef MICROPY_ENABLE_REPL_HELPERS -#define MICROPY_ENABLE_REPL_HELPERS (0) +#ifndef MICROPY_HELPER_REPL +#define MICROPY_HELPER_REPL (0) #endif // Whether to include lexer helper function for unix -#ifndef MICROPY_ENABLE_LEXER_UNIX -#define MICROPY_ENABLE_LEXER_UNIX (0) +#ifndef MICROPY_HELPER_LEXER_UNIX +#define MICROPY_HELPER_LEXER_UNIX (0) #endif // Long int implementation @@ -277,12 +286,6 @@ typedef double mp_float_t; #define MICROPY_CPYTHON_COMPAT (1) #endif -// Maximum length of a path in the filesystem -// So we can allocate a buffer on the stack for path manipulation in import -#ifndef MICROPY_PATH_MAX -#define MICROPY_PATH_MAX (512) -#endif - // Whether POSIX-semantics non-blocking streams are supported #ifndef MICROPY_STREAMS_NON_BLOCK #define MICROPY_STREAMS_NON_BLOCK (0) @@ -290,23 +293,26 @@ typedef double mp_float_t; // Whether to use computed gotos in the VM, or a switch // Computed gotos are roughly 10% faster, and increase VM code size by a little -#ifndef MICROPY_USE_COMPUTED_GOTO -#define MICROPY_USE_COMPUTED_GOTO (0) +#ifndef MICROPY_OPT_COMPUTED_GOTO +#define MICROPY_OPT_COMPUTED_GOTO (0) #endif +/*****************************************************************************/ +/* Hooks for a port to add builtins */ + // Additional builtin function definitions - see builtintables.c:builtin_object_table for format. -#ifndef MICROPY_EXTRA_BUILTINS -#define MICROPY_EXTRA_BUILTINS +#ifndef MICROPY_PORT_BUILTINS +#define MICROPY_PORT_BUILTINS #endif // Additional builtin module definitions - see builtintables.c:builtin_module_table for format. -#ifndef MICROPY_EXTRA_BUILTIN_MODULES -#define MICROPY_EXTRA_BUILTIN_MODULES +#ifndef MICROPY_PORT_BUILTIN_MODULES +#define MICROPY_PORT_BUILTIN_MODULES #endif // Additional constant definitions for the compiler - see compile.c:mp_constants_table. -#ifndef MICROPY_EXTRA_CONSTANTS -#define MICROPY_EXTRA_CONSTANTS +#ifndef MICROPY_PORT_CONSTANTS +#define MICROPY_PORT_CONSTANTS #endif /*****************************************************************************/ diff --git a/py/parse.c b/py/parse.c index f5efd7a4f4..4bc78f14a9 100644 --- a/py/parse.c +++ b/py/parse.c @@ -134,13 +134,13 @@ STATIC void push_rule(parser_t *parser, int src_line, const rule_t *rule, int ar return; } if (parser->rule_stack_top >= parser->rule_stack_alloc) { - rule_stack_t *rs = m_renew_maybe(rule_stack_t, parser->rule_stack, parser->rule_stack_alloc, parser->rule_stack_alloc + MP_ALLOC_PARSE_RULE_INC); + rule_stack_t *rs = m_renew_maybe(rule_stack_t, parser->rule_stack, parser->rule_stack_alloc, parser->rule_stack_alloc + MICROPY_ALLOC_PARSE_RULE_INC); if (rs == NULL) { memory_error(parser); return; } parser->rule_stack = rs; - parser->rule_stack_alloc += MP_ALLOC_PARSE_RULE_INC; + parser->rule_stack_alloc += MICROPY_ALLOC_PARSE_RULE_INC; } rule_stack_t *rs = &parser->rule_stack[parser->rule_stack_top++]; rs->src_line = src_line; @@ -263,13 +263,13 @@ STATIC void push_result_node(parser_t *parser, mp_parse_node_t pn) { return; } if (parser->result_stack_top >= parser->result_stack_alloc) { - mp_parse_node_t *pn = m_renew_maybe(mp_parse_node_t, parser->result_stack, parser->result_stack_alloc, parser->result_stack_alloc + MP_ALLOC_PARSE_RESULT_INC); + mp_parse_node_t *pn = m_renew_maybe(mp_parse_node_t, parser->result_stack, parser->result_stack_alloc, parser->result_stack_alloc + MICROPY_ALLOC_PARSE_RESULT_INC); if (pn == NULL) { memory_error(parser); return; } parser->result_stack = pn; - parser->result_stack_alloc += MP_ALLOC_PARSE_RESULT_INC; + parser->result_stack_alloc += MICROPY_ALLOC_PARSE_RESULT_INC; } parser->result_stack[parser->result_stack_top++] = pn; } @@ -350,11 +350,11 @@ mp_parse_node_t mp_parse(mp_lexer_t *lex, mp_parse_input_kind_t input_kind, mp_p parser.had_memory_error = false; - parser.rule_stack_alloc = MP_ALLOC_PARSE_RULE_INIT; + parser.rule_stack_alloc = MICROPY_ALLOC_PARSE_RULE_INIT; parser.rule_stack_top = 0; parser.rule_stack = m_new_maybe(rule_stack_t, parser.rule_stack_alloc); - parser.result_stack_alloc = MP_ALLOC_PARSE_RESULT_INIT; + parser.result_stack_alloc = MICROPY_ALLOC_PARSE_RESULT_INIT; parser.result_stack_top = 0; parser.result_stack = m_new_maybe(mp_parse_node_t, parser.result_stack_alloc); diff --git a/py/repl.c b/py/repl.c index 4aff80018c..457ce165b7 100644 --- a/py/repl.c +++ b/py/repl.c @@ -28,7 +28,7 @@ #include "mpconfig.h" #include "repl.h" -#if MICROPY_ENABLE_REPL_HELPERS +#if MICROPY_HELPER_REPL bool str_startswith_word(const char *str, const char *head) { int i; @@ -107,4 +107,4 @@ bool mp_repl_continue_with_input(const char *input) { return false; } -#endif // MICROPY_ENABLE_REPL_HELPERS +#endif // MICROPY_HELPER_REPL diff --git a/py/repl.h b/py/repl.h index 36acfc321e..92688f9f9a 100644 --- a/py/repl.h +++ b/py/repl.h @@ -24,6 +24,6 @@ * THE SOFTWARE. */ -#if MICROPY_ENABLE_REPL_HELPERS +#if MICROPY_HELPER_REPL bool mp_repl_continue_with_input(const char *input); #endif diff --git a/py/scope.c b/py/scope.c index ab29af78ab..839e8216c1 100644 --- a/py/scope.c +++ b/py/scope.c @@ -71,7 +71,7 @@ scope_t *scope_new(scope_kind_t kind, mp_parse_node_t pn, qstr source_file, uint } scope->raw_code = mp_emit_glue_new_raw_code(); scope->emit_options = emit_options; - scope->id_info_alloc = MP_ALLOC_SCOPE_ID_INIT; + scope->id_info_alloc = MICROPY_ALLOC_SCOPE_ID_INIT; scope->id_info = m_new(id_info_t, scope->id_info_alloc); return scope; @@ -92,8 +92,8 @@ id_info_t *scope_find_or_add_id(scope_t *scope, qstr qstr, bool *added) { // make sure we have enough memory if (scope->id_info_len >= scope->id_info_alloc) { - scope->id_info = m_renew(id_info_t, scope->id_info, scope->id_info_alloc, scope->id_info_alloc + MP_ALLOC_SCOPE_ID_INC); - scope->id_info_alloc += MP_ALLOC_SCOPE_ID_INC; + scope->id_info = m_renew(id_info_t, scope->id_info, scope->id_info_alloc, scope->id_info_alloc + MICROPY_ALLOC_SCOPE_ID_INC); + scope->id_info_alloc += MICROPY_ALLOC_SCOPE_ID_INC; } // add new id to end of array of all ids; this seems to match CPython diff --git a/py/vm.c b/py/vm.c index 123f520280..ee2ec23607 100644 --- a/py/vm.c +++ b/py/vm.c @@ -222,7 +222,7 @@ mp_vm_return_kind_t mp_execute_bytecode2(const byte *code_info, const byte **ip_ mp_obj_t *fastn, mp_obj_t **sp_in_out, mp_exc_stack_t *exc_stack, mp_exc_stack_t **exc_sp_in_out, volatile mp_obj_t inject_exc) { -#if MICROPY_USE_COMPUTED_GOTO +#if MICROPY_OPT_COMPUTED_GOTO #include "vmentrytable.h" #define DISPATCH() do { \ TRACE(ip); \ @@ -276,7 +276,7 @@ outer_dispatch_loop: // loop to execute byte code for (;;) { dispatch_loop: -#if MICROPY_USE_COMPUTED_GOTO +#if MICROPY_OPT_COMPUTED_GOTO DISPATCH(); #else TRACE(ip); @@ -982,7 +982,7 @@ yield: fastn[0] = obj1; return MP_VM_RETURN_EXCEPTION; -#if !MICROPY_USE_COMPUTED_GOTO +#if !MICROPY_OPT_COMPUTED_GOTO } // switch #endif } // for loop diff --git a/qemu-arm/mpconfigport.h b/qemu-arm/mpconfigport.h index 76663ccabe..f760a47639 100644 --- a/qemu-arm/mpconfigport.h +++ b/qemu-arm/mpconfigport.h @@ -2,18 +2,18 @@ // options to control how Micro Python is built +#define MICROPY_ALLOC_PATH_MAX (512) #define MICROPY_EMIT_X64 (0) #define MICROPY_EMIT_THUMB (0) #define MICROPY_EMIT_INLINE_THUMB (0) #define MICROPY_MEM_STATS (0) #define MICROPY_DEBUG_PRINTERS (0) #define MICROPY_ENABLE_GC (0) -#define MICROPY_ENABLE_REPL_HELPERS (0) -#define MICROPY_ENABLE_LEXER_UNIX (0) +#define MICROPY_HELPER_REPL (0) +#define MICROPY_HELPER_LEXER_UNIX (0) #define MICROPY_ENABLE_SOURCE_LINE (0) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE) -#define MICROPY_PATH_MAX (512) #define MICROPY_ENABLE_MOD_IO (0) // type definitions for the specific machine @@ -30,6 +30,6 @@ typedef const void *machine_const_ptr_t; // must be of pointer size // extra built in names to add to the global namespace extern const struct _mp_obj_fun_native_t mp_builtin_open_obj; -#define MICROPY_EXTRA_BUILTINS \ +#define MICROPY_PORT_BUILTINS \ { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h index 59934b948b..d10e3142f6 100644 --- a/stmhal/mpconfigport.h +++ b/stmhal/mpconfigport.h @@ -26,17 +26,17 @@ // options to control how Micro Python is built +#define MICROPY_ALLOC_PATH_MAX (128) #define MICROPY_EMIT_THUMB (1) #define MICROPY_EMIT_INLINE_THUMB (1) #define MICROPY_ENABLE_GC (1) #define MICROPY_ENABLE_FINALISER (1) -#define MICROPY_ENABLE_REPL_HELPERS (1) +#define MICROPY_HELPER_REPL (1) #define MICROPY_ENABLE_SOURCE_LINE (1) #define MICROPY_ENABLE_FROZENSET (1) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) -#define MICROPY_PATH_MAX (128) -#define MICROPY_USE_COMPUTED_GOTO (1) +#define MICROPY_OPT_COMPUTED_GOTO (1) /* Enable FatFS LFNs 0: Disable LFN feature. 1: Enable LFN with static working buffer on the BSS. Always NOT reentrant. @@ -53,7 +53,7 @@ extern const struct _mp_obj_fun_native_t mp_builtin_help_obj; extern const struct _mp_obj_fun_native_t mp_builtin_input_obj; extern const struct _mp_obj_fun_native_t mp_builtin_open_obj; -#define MICROPY_EXTRA_BUILTINS \ +#define MICROPY_PORT_BUILTINS \ { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \ { 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 }, @@ -63,14 +63,14 @@ extern const struct _mp_obj_module_t os_module; extern const struct _mp_obj_module_t pyb_module; extern const struct _mp_obj_module_t stm_module; extern const struct _mp_obj_module_t time_module; -#define MICROPY_EXTRA_BUILTIN_MODULES \ +#define MICROPY_PORT_BUILTIN_MODULES \ { MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&os_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_pyb), (mp_obj_t)&pyb_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_stm), (mp_obj_t)&stm_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module }, \ // extra constants -#define MICROPY_EXTRA_CONSTANTS \ +#define MICROPY_PORT_CONSTANTS \ { MP_OBJ_NEW_QSTR(MP_QSTR_pyb), (mp_obj_t)&pyb_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_stm), (mp_obj_t)&stm_module }, \ diff --git a/teensy/mpconfigport.h b/teensy/mpconfigport.h index dfa46cc504..c01f13a6dd 100644 --- a/teensy/mpconfigport.h +++ b/teensy/mpconfigport.h @@ -5,7 +5,7 @@ #define MICROPY_EMIT_THUMB (1) #define MICROPY_EMIT_INLINE_THUMB (1) #define MICROPY_ENABLE_GC (1) -#define MICROPY_ENABLE_REPL_HELPERS (1) +#define MICROPY_HELPER_REPL (1) #define MICROPY_ENABLE_FLOAT (1) // type definitions for the specific machine diff --git a/unix-cpy/mpconfigport.h b/unix-cpy/mpconfigport.h index 1fc9e18a5a..99b735870d 100644 --- a/unix-cpy/mpconfigport.h +++ b/unix-cpy/mpconfigport.h @@ -27,7 +27,7 @@ // options to control how Micro Python is built #define MICROPY_EMIT_CPYTHON (1) -#define MICROPY_ENABLE_LEXER_UNIX (1) +#define MICROPY_HELPER_LEXER_UNIX (1) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE) #define MICROPY_ENABLE_MOD_IO (0) diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index 6cac4f4cc7..ec8989f2f8 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -26,6 +26,7 @@ // options to control how Micro Python is built +#define MICROPY_ALLOC_PATH_MAX (PATH_MAX) #define MICROPY_EMIT_X64 (1) #define MICROPY_EMIT_THUMB (0) #define MICROPY_EMIT_INLINE_THUMB (0) @@ -34,14 +35,13 @@ #define MICROPY_ENABLE_FROZENSET (1) #define MICROPY_MEM_STATS (1) #define MICROPY_DEBUG_PRINTERS (1) -#define MICROPY_ENABLE_REPL_HELPERS (1) -#define MICROPY_ENABLE_LEXER_UNIX (1) +#define MICROPY_HELPER_REPL (1) +#define MICROPY_HELPER_LEXER_UNIX (1) #define MICROPY_ENABLE_SOURCE_LINE (1) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) -#define MICROPY_PATH_MAX (PATH_MAX) #define MICROPY_STREAMS_NON_BLOCK (1) -#define MICROPY_USE_COMPUTED_GOTO (1) +#define MICROPY_OPT_COMPUTED_GOTO (1) #define MICROPY_MOD_SYS_EXIT (1) #define MICROPY_MOD_SYS_STDFILES (1) #define MICROPY_ENABLE_MOD_CMATH (1) @@ -66,7 +66,7 @@ extern const struct _mp_obj_module_t mp_module_ffi; #define MICROPY_MOD_TIME_DEF #endif -#define MICROPY_EXTRA_BUILTIN_MODULES \ +#define MICROPY_PORT_BUILTIN_MODULES \ MICROPY_MOD_FFI_DEF \ MICROPY_MOD_TIME_DEF \ { MP_OBJ_NEW_QSTR(MP_QSTR_microsocket), (mp_obj_t)&mp_module_socket }, \ @@ -91,6 +91,6 @@ typedef const void *machine_const_ptr_t; // must be of pointer size extern const struct _mp_obj_fun_native_t mp_builtin_input_obj; extern const struct _mp_obj_fun_native_t mp_builtin_open_obj; -#define MICROPY_EXTRA_BUILTINS \ +#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 }, diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h index 974c454d39..d6ab70b874 100644 --- a/windows/mpconfigport.h +++ b/windows/mpconfigport.h @@ -31,14 +31,14 @@ #define MICROPY_USE_READLINE (0) #endif -#define MICROPY_PATH_MAX (260) //see minwindef.h for msvc or limits.h for mingw +#define MICROPY_ALLOC_PATH_MAX (260) //see minwindef.h for msvc or limits.h for mingw #define MICROPY_EMIT_X64 (0) #define MICROPY_EMIT_THUMB (0) #define MICROPY_EMIT_INLINE_THUMB (0) #define MICROPY_MEM_STATS (1) #define MICROPY_DEBUG_PRINTERS (1) -#define MICROPY_ENABLE_REPL_HELPERS (1) -#define MICROPY_ENABLE_LEXER_UNIX (1) +#define MICROPY_HELPER_REPL (1) +#define MICROPY_HELPER_LEXER_UNIX (1) #define MICROPY_ENABLE_MOD_CMATH (1) #define MICROPY_MOD_SYS_STDFILES (1) #define MICROPY_MOD_SYS_EXIT (1) @@ -69,11 +69,11 @@ typedef void *machine_ptr_t; // must be of pointer size typedef const void *machine_const_ptr_t; // must be of pointer size extern const struct _mp_obj_fun_native_t mp_builtin_open_obj; -#define MICROPY_EXTRA_BUILTINS \ +#define MICROPY_PORT_BUILTINS \ { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, extern const struct _mp_obj_module_t mp_module_time; -#define MICROPY_EXTRA_BUILTIN_MODULES \ +#define MICROPY_PORT_BUILTIN_MODULES \ { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&mp_module_time }, \ #include "realpath.h" @@ -95,7 +95,7 @@ void msec_sleep(double msec); // CL specific overrides from mpconfig #define NORETURN __declspec(noreturn) -#define MICROPY_EXTRA_CONSTANTS { "dummy", 0 } //can't have zero-sized array +#define MICROPY_PORT_CONSTANTS { "dummy", 0 } //can't have zero-sized array // CL specific definitions