- 10 Oct, 2017 8 commits
-
-
Damien George authored
Reduces code size by a tiny bit.
-
Damien George authored
NaN may have the sign bit set but it has no meaning, so don't print it out.
-
Damien George authored
-
Damien George authored
So that a pointer to it can be passed as a pointer to math_generic_1. This patch also makes the function work for single and double precision floating point.
-
Damien George authored
This patch changes how most of the plain math functions are implemented: there are now two generic math wrapper functions that take a pointer to a math function (like sin, cos) and perform the necessary conversion to and from MicroPython types. This helps to reduce code size. The generic functions can also check for math domain errors in a generic way, by testing if the result is NaN or infinity combined with finite inputs. The result is that, with this patch, all math functions now have full domain error checking (even gamma and lgamma) and code size has decreased for most ports. Code size changes in bytes for those with the math module are: unix x64: -432 unix nanbox: -792 stm32: -88 esp8266: +12 Tests are also added to check domain errors are handled correctly.
-
Mike Causer authored
-
Mike Causer authored
-
Mike Causer authored
-
- 09 Oct, 2017 3 commits
-
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
- 08 Oct, 2017 1 commit
-
-
Paul Sokolovsky authored
Add these methods to this "GPIO output emulated with console prints" config.
-
- 07 Oct, 2017 4 commits
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
While this console API improves handling on real hardware boards (e.g. clipboard paste is much more reliable, as well as programmatic communication), it vice-versa poses problems under QEMU, apparently because it doesn't emulate UART interrupt handling faithfully. That leads to inability to run the testsuite on QEMU at all. To work that around, we have to suuport both old and new console routines, and use the old ones under QEMU.
-
Paul Sokolovsky authored
We want to close communication object even if there were exceptions somewhere in the code. This is important for --device exec:/execpty: which may otherwise leave processing running in the background.
-
Paul Sokolovsky authored
Ideally, these should be configurable from Python (using network module), but as that doesn't exist, we better off using Zephyr's native bootstrap configuration facility.
-
- 06 Oct, 2017 3 commits
-
-
Damien George authored
-
Damien George authored
The poweroff() and poweron() methods are used to do soft power control of the display, and this patch makes these methods work the same for both I2C and SPI interfaces.
-
Tiago Queiroz authored
After a poweroff(), the poweron() method does a soft power-on and any previous state of the display persists.
-
- 05 Oct, 2017 3 commits
-
-
Paul Sokolovsky authored
As it may contain newlines, etc.
-
Damien George authored
-
Li Weiwei authored
When wiznet5k_socket_accept is called, if a socket is established, get the IP address of the socket.
-
- 04 Oct, 2017 8 commits
-
-
Damien George authored
The binary and unary ops have changed bytecode encoding.
-
Damien George authored
-
Damien George authored
2 non-bytecode binary ops (NOT_IN and IN_NOT) are moved out of the bytecode group, so this change will change the bytecode format.
-
Damien George authored
-
Damien George authored
Printing "(null)" when a NULL string pointer is passed to %s is a debugging feature and not a feature that's relied upon by the code. So it only needs to be compiled in when debugging (such as assert) is enabled, and saves roughy 30 bytes of code when disabled. This patch also fixes this NULL check to not do the check if the precision is specified as zero.
-
Damien George authored
Because a lot of string processing functions assume there is a null terminating byte, so they can work in an efficient way. Fixes issue #3334.
-
Damien George authored
Header files that are considered internal to the py core and should not normally be included directly are: py/nlr.h - internal nlr configuration and declarations py/bc0.h - contains bytecode macro definitions py/runtime0.h - contains basic runtime enums Instead, the top-level header files to include are one of: py/obj.h - includes runtime0.h and defines everything to use the mp_obj_t type py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h, and defines everything to use the general runtime support functions Additional, specific headers (eg py/objlist.h) can be included if needed.
-
Damien George authored
Qstr values fit in 16-bits (and this fact is used elsewhere in the code) so no need to use more than that for the large lookup tables. The compiler will anyway give a warning if the qstr values don't fit in 16 bits. Saves around 80 bytes of code space for Thumb2 archs.
-
- 03 Oct, 2017 7 commits
-
-
Gabe authored
-
chrismas9 authored
Building mpy-cross: this patch adds .exe to the PROG name when building executables for host (eg mpy-cross) on Windows. make clean now removes mpy-cross.exe under Windows. Building MicroPython: this patch sets MPY_CROSS to mpy-cross.exe or mpy-cross so they can coexist and use cygwin or WSL without rebuilding mpy-cross. The dependency in the mpy rule now uses mpy-cross.exe for Windows and mpy-cross for Linux.
-
Damien George authored
Sending byte-by-byte is inefficient and leads to errors in the WebSocket protocol when sending utf-8 encoded characters.
-
Damien George authored
-
Damien George authored
-
Damien George authored
CPython docs explicitly state that the RHS of a set/frozenset binary op must be a set to prevent user errors. It also preserves commutativity of the ops, eg: "abc" & set() is a TypeError, and so should be set() & "abc". This change actually decreases unix (x64) code by 160 bytes; it increases stm32 by 4 bytes and esp8266 by 28 bytes (but previous patch already introduced a much large saving).
-
Damien George authored
A lot of set's methods (the mutable ones) are not allowed to operate on a frozenset, and giving frozenset a separate locals dict with only the methods that it supports allows to simplify the logic that verifies if args are a set or a frozenset. Even though the new frozenset locals dict is relatively large (88 bytes on 32-bit archs) there is a much bigger saving coming from the removal of a const string for an error message, along with the removal of some checks for set or frozenset type. Changes in code size due to this patch are (for ports that changed at all): unix x64: -56 unix nanbox: -304 stm32: -64 esp8266: -124 cc3200: -40 Apart from the reduced code, frozenset now has better tab-completion because it only lists the valid methods. And the error message for accessing an invalid method is now more detailed (it includes the method name that wasn't found).
-
- 02 Oct, 2017 3 commits
-
-
Paul Sokolovsky authored
These now should be caught properly and lead to RuntimeError instead of crash.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-