summaryrefslogtreecommitdiffstatshomepage
path: root/lib/utils/pyexec.h
Commit message (Collapse)AuthorAge
* shared: Introduce new top-level dir and move 1st party lib code there.Damien George2021-07-12
| | | | | | | | | | | | | | | | | | | | | | This commit moves all first-party code developed for this project from lib/ to shared/, so that lib/ now only contains third-party code. The following directories are moved as-is from lib to shared: lib/libc -> shared/libc lib/memzip -> shared/memzip lib/netutils -> shared/netutils lib/timeutils -> shared/timeutils lib/upytesthelper -> shared/upytesthelper All files in lib/embed/ have been moved to shared/libc/. lib/mp-readline has been moved to shared/readline. lib/utils has been moved to shared/runtime, with the exception of lib/utils/printf.c which has been moved to shared/libc/printf.c. Signed-off-by: Damien George <damien@micropython.org>
* lib/utils: Remove unused PYEXEC_SWITCH_MODE from pyexec.h.Damien George2021-04-24
| | | | | | It was made obsolete by commit c98c128fe885e539ecd73843756340f8950115c8. Signed-off-by: Damien George <damien@micropython.org>
* lib/utils: Change default value of pyexec_mode_kind to 0 to put in bss.odewdney2020-02-04
| | | | | | | | | By simply reordering the enums for pyexec_mode_kind_t it eliminates a data variable which costs ROM to initialise it. And the minimal build now has nothing in the data section. It seems the compiler is smart enough so that the generated code for if-logic which tests these enum values is unchanged.
* lib/utils/pyexec: Introduce MICROPY_REPL_INFO, wrap debug prints in it.Yonatan Goldschmidt2019-12-28
| | | | | | | | | | For the 3 ports that already make use of this feature (stm32, nrf and teensy) this doesn't make any difference, it just allows to disable it from now on. For other ports that use pyexec, this decreases code size because the debug printing code is dead (it can't be enabled) but the compiler can't deduce that, so code is still emitted.
* lib/utils/pyexec: Add pyexec_file_if_exists() helper function.Damien George2019-04-26
| | | | It will only execute the script if it can be stat'd and is a file.
* lib/utils: Expose pyb_set_repl_info function publicGlenn Ruben Bakke2018-07-18
| | | | | | | The patch enables the possibility to disable or initialize the repl info from outside of the module. Can also be used to initialize the repl_display_debugging_info in pyexec.c if not startup file is clearing .bss segment.
* lib/utils/pyexec.h: Include py/obj.h because its decls are needed.Damien George2018-01-31
|
* all: Use the name MicroPython consistently in commentsAlexander Steffen2017-07-31
| | | | | There were several different spellings of MicroPython present in comments, when there should be only one.
* all: Unify header guard usage.Alexander Steffen2017-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
* py: Be more specific with MP_DECLARE_CONST_FUN_OBJ macros.Damien George2016-10-21
| | | | | | | In order to have more fine-grained control over how builtin functions are constructed, the MP_DECLARE_CONST_FUN_OBJ macros are made more specific, with suffix of _0, _1, _2, _3, _VAR, _VAR_BETEEN or _KW. These names now match the MP_DEFINE_CONST_FUN_OBJ macros.
* lib/utils/pyexec: Allow behaviour of SystemExit to be configurable.Damien George2016-10-17
| | | | | Setting the pyexec_system_exit variable to PYEXEC_FORCED_EXT allows SystemExit exceptions to terminate the pyexec functions.
* esp8266: Disallow recursive calls to REPL.Paul Sokolovsky2016-04-01
| | | | | | | | | Before this change, if REPL blocked executing some code, it was possible to still input new statememts and excuting them, all leading to weird, and portentially dangerous interaction. TODO: Current implementation may have issues processing input accumulated while REPL was blocked.
* lib/utils: Add pyexec_frozen_module to load and execute frozen module.Damien George2015-12-26
| | | | | | This is a convenience function similar to pyexec_file. It should be used instead of raw mp_parse_compile_execute because the latter does not catch and report exceptions.
* lib/pyexec: Move header pyexec.h from stmhal directory.Damien George2015-11-09