aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-03-20esp8266/machine_pin: Add "hard" parameter to pin.irq, soft by default.Damien George
2017-03-20esp8266: Change machine.Timer callback to soft callback.Damien George
2017-03-20esp8266: Enable micropython.schedule() with locking in pin callback.Damien George
2017-03-20stmhal: Enable micropython.schedule().Damien George
ExtInt, Timer and CAN IRQ callbacks are made to work with the scheduler. They are still hard IRQs by default, but one can now call micropython.schedule within the hard IRQ to schedule a soft callback.
2017-03-20unix: Use mp_handle_pending() in time.sleep().Damien George
2017-03-20py: Add micropython.schedule() function and associated runtime code.Damien George
2017-03-20py/objstr: Use better msg in bad implicit str/bytes conversion exceptionstijn
Instead of always reporting some object cannot be implicitly be converted to a 'str', even when it is a 'bytes' object, adjust the logic so that when trying to convert str to bytes it is shown like that. This will still report bad implicit conversion from e.g. 'int to bytes' as 'int to str' but it will not result in the confusing 'can't convert 'str' object to str implicitly' anymore for calls like b'somestring'.count('a').
2017-03-17utime module documentation fixes and cleanup:Christopher Arndt
* Fix mis-spelling of `ticks_add` in code examples. * Be consistent about parentheses after function names. * Be consistent about formatting of function, variable and constant names. * Be consistent about spaces and punctuation. * Fix some language errors (missing or wrong words, wrong word order). * Keep line length under 90 chars. Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
2017-03-17py: Provide mp_decode_uint_value to help optimise stack usage.Damien George
This has a noticeable improvement on x86-64 and Thumb2 archs, where stack usage is reduced by 2 machine words in the VM.
2017-03-17py: Reduce size of mp_code_state_t structure.Damien George
Instead of caching data that is constant (code_info, const_table and n_state), store just a pointer to the underlying function object from which this data can be derived. This helps reduce stack usage for the case when the mp_code_state_t structure is stored on the stack, as well as heap usage when it's stored on the heap. The downside is that the VM becomes a little more complex because it now needs to derive the data from the underlying function object. But this doesn't impact the performance by much (if at all) because most of the decoding of data is done outside the main opcode loop. Measurements using pystone show that little to no performance is lost. This patch also fixes a nasty bug whereby the bytecode can be reclaimed by the GC during execution. With this patch there is always a pointer to the function object held by the VM during execution, since it's stored in the mp_code_state_t structure.
2017-03-16tests/basics/bytes_add: Add tests for optimised bytes addition.Damien George
2017-03-16py/objstr: Fix eager optimisation of str/bytes addition.Damien George
The RHS can only be returned if it is the same type as the LHS.
2017-03-15travis: Change an stmhal rule to build PYBV11 instead of default PYBV10.Damien George
This allows to test the PYBV11 target as well as the network drivers without adding another rule. It also removes the need to use -B, side-stepping the issue of whether or not -B works with qstr auto generation.
2017-03-15docs/library/framebuf: Fix typo in bit-width for MVLSB description.Damien George
2017-03-15py/mkrules.mk: Remove special check for "-B" in qstr auto generation.Damien George
When make is passed "-B" it seems that everything is considered out-of-date and so $? expands to all prerequisites. Thus there is no need for a special check to see if $? is emtpy.
2017-03-15tests/basics: Move string-modulo-format int tests to dedicated file.Damien George
2017-03-15tests/basics: Add test for string module formatting with int argument.Damien George
2017-03-15tests/basics/string_format2: Adjust comment now that tests succeed.Damien George
2017-03-15py/mpprint: Fix int formatting so "+" is printed for 0-valued integer.Damien George
2017-03-15py/emitnative: Remove obsolete commented out code.Damien George
2017-03-14tests/micropython/viper_error: Add more tests to improve coverage.Damien George
2017-03-14py/emitnative: Use assertions and mp_not_implemented correctly.Damien George
Assertions are used to check expressions that should always be true, and mp_not_implemented is used for code that can be reached.
2017-03-14tests/extmod: Improve tinfgzip.c test coverage.Rami Ali
2017-03-14tests/extmod/vfs_basic: Unmount all existing devices before doing test.Damien George
This is so the test can run successfully on targets that already have something mounted.
2017-03-14tests/run-tests: Re-instate skipping of doubleprec test on pyboard.Damien George
2017-03-14lib/utils/pyexec: Fix bug with pyexec_file not setting flag for source.Damien George
2017-03-14tests/basics/struct_micropython: Add test for 'S' typecode in ustruct.Damien George
The 'S' typecode is a uPy extension so it should be grouped with the other extension (namely 'O' typecode). Testing 'S' needs uctypes which is an extmod module and not always available, so this test is made optional and will only be run on ports that have (u)struct and uctypes. Otherwise it will be silently skipped.
2017-03-14tests: Improve binary.c test coverage.Rami Ali
2017-03-14tests/extmod: Improve re1.5/recursiveloop.c test coverage.Rami Ali
2017-03-14tests/extmod/vfs_basic: Add more tests for basic VFS functionality.Damien George
2017-03-14py/objint: Allow to print long-long ints without using the heap.Damien George
Some stack is allocated to format ints, and when the int implementation uses long-long there should be additional stack allocated compared with the other cases. This patch uses the existing "fmt_int_t" type to determine the amount of stack to allocate.
2017-03-14esp8266: Only execute main.py if in friendly REPL mode.Damien George
2017-03-14teensy/lexerfrozen: Make mp_lexer_new_from_file raise an exception.Damien George
2017-03-14mpy-cross/main: Move lexer constructor to within NLR handler block.Damien George
2017-03-14pic16bit/main: Make mp_lexer_new_from_file raise an exception.Damien George
2017-03-14lib/memzip: Make lexer constructor raise exception when file not found.Damien George
2017-03-14examples/embedding: Place lexer constructor within NLR handler block.Damien George
The lexer constructor may now raise an exception and it needs to be caught.
2017-03-14esp8266: Update lexer constructors so they can raise exceptions.Damien George
2017-03-14zephyr/main: Move lexer constructor to within NLR handler block.Damien George
And raise an exception when mp_lexer_new_from_file is called.
2017-03-14qemu-arm: Move lexer constructors to within NLR handler block.Damien George
And raise an exception when mp_lexer_new_from_file is called.
2017-03-14minimal/main: Move lexer constructor to within NLR handler block.Damien George
And raise an exception when mp_lexer_new_from_file is called.
2017-03-14bare-arm/main: Move lexer constructor to within NLR handler block.Damien George
And raise an exception when mp_lexer_new_from_file is called.
2017-03-14unix/main: Refactor to put lexer constructors all in one place.Damien George
The lexer can now raise an exception on construction so it must go within an nlr handler block.
2017-03-14lib/utils/pyexec: Refactor to put lexer constructors all in one place.Damien George
The lexer can now raise an exception on construction so it must go within an nlr handler block.
2017-03-14py: Allow lexer to raise exceptions during construction.Damien George
This patch refactors the error handling in the lexer, to simplify it (ie reduce code size). A long time ago, when the lexer/parser/compiler were first written, the lexer and parser were designed so they didn't use exceptions (ie nlr) to report errors but rather returned an error code. Over time that has gradually changed, the parser in particular has more and more ways of raising exceptions. Also, the lexer never really handled all errors without raising, eg there were some memory errors which could raise an exception (and in these rare cases one would get a fatal nlr-not-handled fault). This patch accepts the fact that the lexer can raise exceptions in some cases and allows it to raise exceptions to handle all its errors, which are for the most part just out-of-memory errors during construction of the lexer. This makes the lexer a bit simpler, and also the persistent code stuff is simplified. What this means for users of the lexer is that calls to it must be wrapped in a nlr handler. But all uses of the lexer already have such an nlr handler for the parser (and compiler) so that doesn't put any extra burden on the callers.
2017-03-14pic16bit/main: Make nlr_jump_fail never return.Damien George
2017-03-14zephyr/main: Remove unused __fatal_error().Paul Sokolovsky
2017-03-13tests/extmod: Add a test for core VFS functionality, sans any filesystem.Damien George
2017-03-13extmod/vfs: Rewrite path lookup algo to support relative paths from root.Damien George
For example, if the current directory is the root dir then this patch allows one to do uos.listdir('mnt'), where 'mnt' is a valid mount point. Previous to this patch such a thing would not work, on needed to do uos.listdir('/mnt') instead.
2017-03-13qemu-arm: Add basic uos module with generic VFS capabilities.Damien George