- 11 Oct, 2015 1 commit
-
-
Damien George authored
Use CTRL-E to enter paste mode. Prompt starts with "===" and accepts all characters verbatim, echoing them back. Only control characters are CTRL-C which cancels the input and returns to normal REPL, and CTRL-D which ends the input and executes it. The input is executed as though it were a file. The input is not added to the prompt history.
-
- 01 Oct, 2015 1 commit
-
-
Damien George authored
With this patch parse nodes are allocated sequentially in chunks. This reduces fragmentation of the heap and prevents waste at the end of individually allocated parse nodes. Saves roughly 20% of RAM during parse stage.
-
- 05 May, 2015 1 commit
-
-
Damien George authored
esp8266 port now has working raw and friendly REPL, as well as working soft reset (CTRL-D at REPL, or raise SystemExit). tools/pyboard.py now works with esp8266 port.
-
- 29 Apr, 2015 1 commit
-
-
Dave Hylands authored
This allows errors to be seen and prevents hanging the board from doing: pyb.disable_irq()
-
- 28 Apr, 2015 2 commits
-
-
Damien George authored
-
Damien George authored
Also rename py-version.h to mpversion.h for consistency with mpconfig.h.
-
- 19 Apr, 2015 1 commit
-
-
Damien George authored
-
- 16 Apr, 2015 1 commit
-
-
Damien George authored
Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
-
- 13 Feb, 2015 1 commit
-
-
Damien George authored
Now all ports can use pybstdio.c to provide sys.stdin/stdout/stderr, so long as they implement mp_hal_stdin_* and mp_hal_stdout_* functions.
-
- 08 Feb, 2015 1 commit
-
-
Damien George authored
-
- 07 Feb, 2015 1 commit
-
-
Damien George authored
To enable parsing constants more efficiently, mp_parse should be allowed to raise an exception, and mp_compile can already raise a MemoryError. So these functions need to be protected by an nlr push/pop block. This patch adds that feature in all places. This allows to simplify how mp_parse and mp_compile are called: they now raise an exception if they have an error and so explicit checking is not needed anymore.
-
- 29 Jan, 2015 1 commit
-
-
Damien George authored
-
- 28 Jan, 2015 2 commits
-
-
Damien George authored
This cleans up vstr so that it's a pure "variable buffer", and the user can decide whether they need to add a terminating null byte. In most places where vstr is used, the vstr did not need to be null terminated and so this patch saves code size, a tiny bit of RAM, and makes vstr usage more efficient. When null termination is needed it must be done explicitly using vstr_null_terminate.
-
Damien George authored
Makes pyexec.c more re-usable for other ports.
-
- 20 Jan, 2015 1 commit
-
-
Damien George authored
See issue #699.
-
- 15 Jan, 2015 1 commit
-
-
Paul Sokolovsky authored
pyexec_friendly_repl_process_char() and friends, useful for ports which integrate into existing cooperative multitasking system. Unlike readline() refactor before, this was implemented in less formal, trial&error process, minor functionality regressions are still known (like soft&hard reset support). So, original loop-based pyexec_friendly_repl() is left intact, specific implementation selectable by config setting.
-
- 01 Jan, 2015 1 commit
-
-
Damien George authored
-
- 29 Dec, 2014 1 commit
-
-
Damien George authored
-
- 20 Dec, 2014 3 commits
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Helps other ports.
-
- 08 Dec, 2014 1 commit
-
-
Paul Sokolovsky authored
The function is modeled after traceback.print_exception(), but unbloated, and put into existing module to save overhead on adding another module. Compliant traceback.print_exception() is intended to be implemented in micropython-lib in terms of sys.print_exception(). This change required refactoring mp_obj_print_exception() to take pfenv_t interface arguments. Addresses #751.
-
- 05 Dec, 2014 1 commit
-
-
Damien George authored
mp_lexer_t type is exposed, mp_token_t type is removed, and simple lexer functions (like checking current token kind) are now inlined. This saves 784 bytes ROM on 32-bit unix, 348 bytes on stmhal, and 460 bytes on bare-arm. It also saves a tiny bit of RAM since mp_lexer_t is a bit smaller. Also will run a bit more efficiently.
-
- 27 Nov, 2014 1 commit
-
-
Damien George authored
This makes it easier to re-use readline.c and pyexec.c from stmhal in other ports.
-
- 26 Oct, 2014 1 commit
-
-
Damien George authored
Improvements are: 2 ctrl-C's are now needed to truly kill running script on pyboard, so make CDC interface allow multiple ctrl-C's through at once (ie sending b'\x03\x03' to pyboard now counts as 2 ctrl-C's). ctrl-C in friendly-repl can now stop multi-line input. In raw-repl mode, use ctrl-D to indicate end of running script, and also end of any error message. Thus, output of raw-repl is always at least 2 ctrl-D's and it's much easier to parse. pyboard.py is now a bit faster, handles exceptions from pyboard better (prints them and exits with exit code 1), prints out the pyboard output while the script is running (instead of waiting till the end), and allows to follow the output of a previous script when run with no arguments.
-
- 22 Oct, 2014 2 commits
-
-
Damien George authored
There is no need, since we don't (currently) use the value.
-
Dave Hylands authored
-
- 05 Oct, 2014 2 commits
-
-
Damien George authored
Found these by compiling stmhal with mp_uint_t of type uint32_t instead of unsigned int. This actually makes a difference to the code, but just a curiosity.
-
Damien George authored
-
- 23 Sep, 2014 1 commit
-
-
Damien George authored
mp_parse_node_free now frees the memory associated with non-interned strings. And the parser calls mp_parse_node_free when discarding a non-used node (such as a doc string). Also, the compiler now frees the parse tree explicitly just before it exits (as opposed to relying on the caller to do this). Addresses issue #708 as best we can.
-
- 20 Jul, 2014 1 commit
-
-
Damien George authored
Recent changes to builtin print meant that print was printing to the mp_sys_stdout_obj, which was sending data raw to the USB CDC device. The data should be cooked so that \n turns into \r\n.
-
- 26 Jun, 2014 1 commit
-
-
mux authored
-
- 19 Jun, 2014 1 commit
-
-
mux authored
-
- 16 Jun, 2014 1 commit
-
-
Dave Hylands authored
Refactored some stmhal files which are shared with teensy.
-
- 10 May, 2014 1 commit
-
-
Damien George authored
Addresses issue #558, but it's likely that other out-of-memory errors could crash the pyboard. Reason is that qstrs use m_new and can raise an exception within the parser.
-
- 03 May, 2014 4 commits
-
-
Damien George authored
Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
-
Damien George authored
-
Damien George authored
-
Damien George authored
Make include dependencies neater, and adheres to the coding convention that headers should not include headers.
-
- 02 May, 2014 1 commit
-
-
Paul Sokolovsky authored
-