- 27 Sep, 2016 11 commits
-
-
Damien George authored
-
Damien George authored
-
Alex March authored
-
Alex March authored
-
Alex March authored
-
Damien George authored
Having a micropython.const identity function, and writing "from micropython import const" at the start of scripts that use the const feature, allows to write scripts which are compatible with CPython, and with uPy builds that don't include const optimisation. This patch adds such a function and updates the tests to do the import.
-
Damien George authored
This corresponds to the change in the way exception values are stored on the Python value stack.
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
When an exception is raised and is to be handled by the VM, it is stored on the Python value stack so the bytecode can access it. CPython stores 3 objects on the stack for each exception: exc type, exc instance and traceback. uPy followed this approach, but it turns out not to be necessary. Instead, it is enough to store just the exception instance on the Python value stack. The only place where the 3 values are needed explicitly is for the __exit__ handler of a with-statement context, but for these cases the 3 values can be extracted from the single exception instance. This patch removes the need to store 3 values on the stack, and instead just stores the exception instance. Code size is reduced by about 50-100 bytes, the compiler and VM are slightly simpler, generate bytecode is smaller (by 2 bytes for each try block), and the Python value stack is reduced in size for functions that handle exceptions.
-
- 24 Sep, 2016 4 commits
-
-
Paul Sokolovsky authored
Fixes for more pedantic warnings.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
This uses extension introduced in CPython 3.5: if wbits (dictionary size code) has value 16 + 8..15, it means that gzip-formatted stream expected.
-
Paul Sokolovsky authored
-
- 23 Sep, 2016 6 commits
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Damien George authored
This fixes constant substitution so that only standalone identifiers are replaced with their constant value (if they have one). I.e. don't replace NAME in expressions like obj.NAME or NAME = expr.
-
Damien George authored
-
Damien George authored
LIST_APPEND, MAP_ADD and SET_ADD have been removed, and STORE_COMP has been added in adaf0d86.
-
Damien George authored
qstrs ids are restricted to fit within 2 bytes already (eg in persistent bytecode) so it's safe to use a uint16_t to store them in mp_arg_t. And the flags member only needs a maximum of 2 bytes so can also use uint16_t. Savings in code size can be significant when many mp_arg_t structs are used for argument parsing. Eg, this patch reduces stmhal by 480 bytes.
-
- 22 Sep, 2016 8 commits
-
-
Paul Sokolovsky authored
In CPython, module-level .wrap_socket() function actually doesn't accept (or document) this param, only SSLContext.wrap_socket() has.
-
Radomir Dopieralski authored
When the clock is too fast for the i2c slave, it can temporarily hold down the scl line to signal to the master that it needs to wait. The master should check the scl line when it is releasing it after transmitting data, and wait for it to be released. This change has been tested with a logic analyzer and an i2c slace implemented on an atmega328p using its twi peripheral, clocked at 8Mhz. Without the change, the i2c communication works up to aboy 150kHz frequency, and above that results in the slave stuck in an unresponsive state. With this change, communication has been tested to work up to 400kHz.
-
Krzysztof Blazewicz authored
-
Krzysztof Blazewicz authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
vstr_extend will now only return NULL if the vstr is a fixed buffer, which in this case it is not.
-
Damien George authored
The issue-stats service is not well maintained and likely the situation won't improve in the future. See: https://github.com/hstove/issue_stats/issues/41 https://github.com/hstove/issue_stats/issues/46
-
- 21 Sep, 2016 7 commits
-
-
Paul Sokolovsky authored
This is required to use mbedTLS versions from various sources, e.g. mainline vs embedded into Zephyr RTOS.
-
Paul Sokolovsky authored
Unlike standard keyfile= and certfile=, these accept byte buffer objects (to not depend on FS implementation).
-
Pavol Rusnak authored
-
Stefan Agner authored
Use mp_obj_int_get_truncated to allow the full 32-bit address range as first parameter.
-
Paul Sokolovsky authored
-
Damien George authored
One can instead lookup __name__ in the modules dict to get the value.
-
Stefan Agner authored
Use MP_NOINLINE macro to avoid inlining of init_flash_fs. This helps to keep stack usage of main() low.
-
- 20 Sep, 2016 4 commits
-
-
Paul Sokolovsky authored
-
Delio Brignoli authored
-
Damien George authored
So now ticks_ms can count up to the full 30 bits. Fixes issue #2412.
-
Damien George authored
-