aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-11-24tests/basics: Add test for containment of a subclass of a native type.Damien George
2017-11-24py/runtime: Add MP_BINARY_OP_CONTAINS as reverse of MP_BINARY_OP_IN.Damien George
Before this patch MP_BINARY_OP_IN had two meanings: coming from bytecode it meant that the args needed to be swapped, but coming from within the runtime meant that the args were already in the correct order. This lead to some confusion in the code and comments stating how args were reversed. It also lead to 2 bugs: 1) containment for a subclass of a native type didn't work; 2) the expression "{True} in True" would illegally succeed and return True. In both of these cases it was because the args to MP_BINARY_OP_IN ended up being reversed twice. To fix these things this patch introduces MP_BINARY_OP_CONTAINS which corresponds exactly to the __contains__ special method, and this is the operator that built-in types should implement. MP_BINARY_OP_IN is now only emitted by the compiler and is converted to MP_BINARY_OP_CONTAINS by swapping the arguments.
2017-11-24py/opmethods: Include the correct header for binary op enums.Damien George
By directly including runtime0.h the mpconfig.h settings are not included and so the enums in runtime0.h can be incorrect.
2017-11-24py/runtime: Simplify handling of containment binary operator.Damien George
In mp_binary_op, there is no need to explicitly check for type->getiter being non-null and raising an exception because this is handled exactly by mp_getiter(). So just call the latter unconditionally.
2017-11-23docs/uselect: poll: Explicitly specify that no-timeout value is -1.Paul Sokolovsky
2017-11-23docs: Add notes on heap allocation caused by bound method refs.Peter Hinch
2017-11-23tests/net_hosted: Add test for socket connect() and poll() behaviour.Damien George
2017-11-22py/modbuiltins: Slightly simplify code in builtin round().Damien George
2017-11-21py/objfloat: Allow float() to parse anything with the buffer protocol.Damien George
This generalises and simplifies the code and follows CPython behaviour.
2017-11-20py/objnamedtuple: Allow to reuse namedtuple basic functionality.Paul Sokolovsky
By declaring interface in objnamedtuple.h and introducing a helper allocation function.
2017-11-20py: Add config option to disable multiple inheritance.Damien George
This patch introduces a new compile-time config option to disable multiple inheritance at the Python level: MICROPY_MULTIPLE_INHERITANCE. It is enabled by default. Disabling multiple inheritance eliminates a lot of recursion in the call graph (which is important for some embedded systems), and can be used to reduce code size for ports that are really constrained (by around 200 bytes for Thumb2 archs). With multiple inheritance disabled all tests in the test-suite pass except those that explicitly test for multiple inheritance.
2017-11-20stm32/led: Remove unused LED enum constants.Damien George
2017-11-20stm32/boards: Remove obsolete and unused board-specific defines.Damien George
These board-level macros have been completely replaced by feature-level config options.
2017-11-20stm32/boards: Add support for NUCLEO-F746ZG evaluation board.Jaroslav Sykora
This is a low-cost evaluation kit board from ST based on the STM32 Nucleo-144 form factor. It uses the STM32F746ZG MCU in the LQFP144 package. The MCU has 1MB of flash and 320kB of System RAM. Cortex-M7 runs at up to 216MHz.
2017-11-20stm32/boards/stm32f746_af.csv: Fix typos in AF table.Damien George
2017-11-20extmod/vfs_fat: Mount FatFS on creation so VFS methods can be used.Damien George
It's possible to use the methods (eg ilistdir) of a VFS FatFS object without it being mounted in the VFS itself. This previously worked but only because FatFS was "mounting" the filesystem automatically when any function (eg f_opendir) was called. But it didn't work for ports that used synchronisation objects (_FS_REENTRANT) because they are only initialised via a call to f_mount. So, call f_mount explicitly when creating a new FatFS object so that everything is set up correctly. Then also provide a finaliser to do the f_umount call, but only if synchronisation objects are enabled (since otherwise the f_umount call does nothing).
2017-11-20drivers/nrf24l01: Make driver and test run on pyboard, ESP8266, ESP32.Peter Hinch
2017-11-16docs/library/network: Enhance AbstractNIC.status to take an argument.Damien George
The argument is optional and if given should be a string naming the status variable to query.
2017-11-16py/objstr: When constructing str from bytes, check for existing qstr.Damien George
This patch uses existing qstr data where possible when constructing a str from a bytes object.
2017-11-16py/objstr: Make mp_obj_new_str_of_type check for existing interned qstr.Damien George
The function mp_obj_new_str_of_type is a general str object constructor used in many places in the code to create either a str or bytes object. When creating a str it should first check if the string data already exists as an interned qstr, and if so then return the qstr object. This patch makes the function have such behaviour, which helps to reduce heap usage by reusing existing interned data where possible. The old behaviour of mp_obj_new_str_of_type (which didn't check for existing interned data) is made available through the function mp_obj_new_str_copy, but should only be used in very special cases. One consequence of this patch is that the following expression is now True: 'abc' is ' abc '.split()[0]
2017-11-16py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str.Damien George
This patch simplifies the str creation API to favour the common case of creating a str object that is not forced to be interned. To force interning of a new str the new mp_obj_new_str_via_qstr function is added, and should only be used if warranted. Apart from simplifying the mp_obj_new_str function (and making it have the same signature as mp_obj_new_bytes), this patch also reduces code size by a bit (-16 bytes for bare-arm and roughly -40 bytes on the bare-metal archs).
2017-11-16extmod/vfs: Use existing qstr for forward-slash string object.Damien George
2017-11-15tools/mpy-tool.py: Implement freezing of Ellipsis const object.Damien George
2017-11-15stm32/boards/NUCLEO_F429ZI: Incr CPU freq to 168MHz to get USB working.Damien George
At the original frequency of 90MHz there's no way to get a 48MHz USB clock. These new setting mirror those of the STM32F429DISC board.
2017-11-15py/mkenv.mk: Use $(PYTHON) consistently when calling Python tools.Christopher Arndt
Rationale: * Calling Python build tool scripts from makefiles should be done consistently using `python </path/to/script>`, instead of relying on the correct she-bang line in the script [1] and the executable bit on the script being set. This is more platform-independent. * The name/path of the Python executable should always be used via the makefile variable `PYTHON` set in `py/mkenv.mk`. This way it can be easily overwritten by the user with `make PYTHON=/path/to/my/python`. * The Python executable name should be part of the value of the makefile variable, which stands for the build tool command (e.g. `MAKE_FROZEN` and `MPY_TOOL`), not part of the command line where it is used. If a Python tool is substituted by another (non-python) program, no change to the Makefiles is necessary, except in `py/mkenv.mk`. * This also solves #3369 and #1616. [1] There are systems, where even the assumption that `/usr/bin/env` always exists, doesn't hold true, for example on Android (where otherwise the unix port compiles perfectly well).
2017-11-15py/emitnative: Clean up asm macro names so they have dest as first arg.Damien George
All the asm macro names that convert a particular architecture to a generic interface now follow the convention whereby the "destination" (usually a register) is specified first.
2017-11-14esp8266/esp8266_common.ld: Put .text of more libs into .irom0.text .Paul Sokolovsky
Recent vendor SDKs ship libs with code in .text section, which previously was going into .irom0.text. Adjust the linker script to route these sections back to iROM (follows upstream change).
2017-11-12extmod/moduhashlib: Enable SHA1 hashing when using "mbedtls" library.Christopher Cooper
The SHA1 hashing functionality is provided via the "axtls" library's implementation, and hence is unavailable when the "axtls" library is not being used. This change provides the same SHA1 hashing functionality when using the "mbedtls" library by using its implementation instead.
2017-11-12esp8266/README: Add section on using upip.Paul Sokolovsky
2017-11-12esp8266/README: Emphasize the need to change default WiFi password.Paul Sokolovsky
2017-11-12py/objnamedtuple: Add _asdict function if OrderedDict is supportedstijn
2017-11-11py/objtype: mp_obj_new_type: Name base types related vars more clearly.Paul Sokolovsky
As vars contains array of base types and its length, name them as such, avoid generic "items" and "len" names.
2017-11-10docs/_thread: Add a placeholder docs for _thread module.Paul Sokolovsky
Doesn't list specific API calls yet, the purpose is to let user know that the module exists.
2017-11-08py/mpconfig: Introduce reusable MP_HTOBE32(), etc. macros.Paul Sokolovsky
Macros to convert big-endian values to host byte order and vice-versa. These were defined in adhoc way for some ports (e.g. esp8266), allow reuse, provide default implementations, while allow ports to override.
2017-11-08docs/ure: Emphasize not supported features more.Paul Sokolovsky
Plus, additional descriptions/formatting.
2017-11-07unix/moduselect: Fix nanbox build after adding .dump() method.Paul Sokolovsky
2017-11-07unix/moduselect: Add .dump() method for debugging.Paul Sokolovsky
Commented out by default.
2017-11-05axtls: Update, exposes AES functions to implement ECB chiper mode.Paul Sokolovsky
2017-11-05esp8266/etshal.h: Make function prototypes compatible with ESP SDK 2.1.0+.Paul Sokolovsky
In the vendor SDK 2.1.0, some of the functions which previously didn't have prototypes, finally acquired them. Change prototypes on our side to match those in vendor headers, to avoid warnings-as-errors.
2017-11-04docs/ure: Add flags arg to ure.compile(), mention that ure.DEBUG is optional.Paul Sokolovsky
2017-11-02docs/esp8266/general: Minor grammar fixes.Paul Sokolovsky
2017-11-02extmod/modussl_axtls: Typo fix in comment.Paul Sokolovsky
2017-11-02extmod/modussl_axtls: socket_read: Handle EAGAIN.Paul Sokolovsky
If SSL_EAGAIN is returned (which is a feature of MicroPython's axTLS fork), return EAGAIN. Original axTLS returns SSL_OK both when there's no data to return to user yet and when the underlying stream returns EAGAIN. That's not distinctive enough, for example, original module code works well for blocking stream, but will infinite-loop for non-blocking socket with EAGAIN. But if we fix non-blocking case, blocking calls to .read() will return few None's initially (while axTLS progresses thru handshake). Using SSL_EAGAIN allows to fix non-blocking case without regressing the blocking one. Note that this only handles case of non-blocking reads of application data. Initial handshake and writes still don't support non-blocking mode and must be done in the blocking way.
2017-11-01zephyr/README: "make qemu" was replaced with "make run".Paul Sokolovsky
2017-11-01docs/esp8266/general: TLS limitations: Mention also "ussl" module limitations.Paul Sokolovsky
2017-11-01py/compile: Use alloca instead of qstr_build when compiling import name.Damien George
The technique of using alloca is how dotted import names are composed in mp_import_from and mp_builtin___import__, so use the same technique in the compiler. This puts less pressure on the heap (only the stack is used if the qstr already exists, and if it doesn't exist then the standard qstr block memory is used for the new qstr rather than a separate chunk of the heap) and reduces overall code size.
2017-11-01docs: Bump version to 1.9.3.Damien George
2017-11-01teensy: Get port compiling without any warnings.Damien George
2017-10-31docs/ure: Add "|" (alternative) to the list of supported operators.Paul Sokolovsky
2017-10-31Revert "py/{mkenv.mk,mkrules.mk}: Append .exe for Windows executable files."Damien George
This reverts commit 3289b9b7a76a1230b6bb631e191a47bfc6c7a8ee. The commit broke building on MINGW because the filename became micropython.exe.exe. A proper solution to support more Windows build environments requires more thought and testing.