stm32: Support disabling the compiler.

Disable via "#define MICROPY_ENABLE_COMPILER (0)" in the board's
mpconfigboard.h file.
This commit is contained in:
Damien George 2019-09-26 17:05:40 +10:00
parent 095f90f04e
commit 3328b7d71f
2 changed files with 6 additions and 2 deletions

View File

@ -144,7 +144,9 @@ STATIC mp_obj_t pyb_main(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_a
// parse args
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
#if MICROPY_ENABLE_COMPILER
MP_STATE_VM(mp_optimise_value) = args[0].u_int;
#endif
}
return mp_const_none;
}
@ -701,6 +703,7 @@ soft_reset:
}
}
#if MICROPY_ENABLE_COMPILER
// Main script is finished, so now go into REPL mode.
// The REPL mode can change, or it can request a soft reset.
for (;;) {
@ -714,6 +717,7 @@ soft_reset:
}
}
}
#endif
soft_reset_exit:

View File

@ -101,8 +101,8 @@
#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1)
#define MICROPY_PY_BUILTINS_ROUND_INT (1)
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
#define MICROPY_PY_BUILTINS_COMPILE (1)
#define MICROPY_PY_BUILTINS_EXECFILE (1)
#define MICROPY_PY_BUILTINS_COMPILE (MICROPY_ENABLE_COMPILER)
#define MICROPY_PY_BUILTINS_EXECFILE (MICROPY_ENABLE_COMPILER)
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1)
#define MICROPY_PY_BUILTINS_INPUT (1)
#define MICROPY_PY_BUILTINS_POW3 (1)