summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-08-19extmod/modure: Make regex dump-code debugging feature optional.Damien George
Enabled via MICROPY_PY_URE_DEBUG, disabled by default (but enabled on unix coverage build). This is a rarely used feature that costs a lot of code (500-800 bytes flash). Debugging of regular expressions can be done offline with other tools.
2019-08-19docs/reference/speed_python: Update that read-only buffers are accepted.Peter Hinch
As allowed by recent cd35dd9d9a29836906acdce60c931f6352b536d0
2019-08-19py/nlr: Use MP_UNREACHABLE at the end of arch-specific nlr_jump funcs.Damien George
Recent versions of gcc perform optimisations which can lead to the following code from the MP_NLR_JUMP_HEAD macro being omitted: top->ret_val = val; \ MP_NLR_RESTORE_PYSTACK(top); \ *_top_ptr = top->prev; \ This is noticeable (at least) in the unix coverage on x86-64 built with gcc 9.1.0. This is because the nlr_jump function is marked as no-return, so gcc deduces that the above code has no effect. Adding MP_UNREACHABLE tells the compiler that the asm code may branch elsewhere, and so it cannot optimise away the code.
2019-08-19py: Introduce MP_UNREACHABLE macro to annotate unreachable code.Damien George
And use it to replace the same pattern at the end of nlrthumb.c:nlr_jump.
2019-08-17py/modmath: Implement math.isclose() for non-complex numbers.stijn
As per PEP 485, this function appeared in for Python 3.5. Configured via MICROPY_PY_MATH_ISCLOSE which is disabled by default, but enabled for the ports which already have MICROPY_PY_MATH_SPECIAL_FUNCTIONS enabled.
2019-08-16stm32/i2c: Fix generation of restart condition for hw I2C on F0/F7.Damien George
Before this patch I2C transactions using a hardware I2C peripheral on F0/F7 MCUs would not correctly generate the I2C restart condition, and instead would generate a stop followed by a start. This is because the CR2 AUTOEND bit was being set before CR2 START when the peripheral already had the I2C bus from a previous transaction that did not generate a stop. As a consequence all combined transactions, eg read-then-write for an I2C memory transfer, generated a stop condition after the first transaction and didn't generate a stop at the very end (but still released the bus). Some I2C devices require a repeated start to function correctly. This patch fixes this by making sure the CR2 AUTOEND bit is set after the start condition and slave address have been fully transferred out.
2019-08-16samd/boards: Add Mini SAM M4 board configuration.Jim Mussared
2019-08-16samd/boards: Add Adafruit Feather M0 Express board configuration.Jim Mussared
2019-08-16samd: Make common linker scripts, rename board.mk to mpconfigboard.mk.Jim Mussared
The rename matches other ports, e.g. stm32, and gives consistency with mpconfigboard.h.
2019-08-16esp32: Add per-board configs, following other ports.Jim Mussared
Replaces the `SDKCONFIG` makefile variable with `BOARD`. Defaults to BOARD=GENERIC. spiram can be enabled with `BOARD=GENERIC_SPIRAM` Add example definition for TINYPICO, currently identical to GENERIC_SPIRAM but with custom board/SoC names for the uPy banner.
2019-08-16gitignore: Put build-*/ pattern in top-level gitignore file.Damien George
2019-08-15py/objarray: Fix amount of free space in array when doing slice assign.Damien George
Prior to this patch the amount of free space in an array (including bytearray) was not being maintained correctly for the case of slice assignment which changed the size of the array. Under certain cases (as encoded in the new test) it was possible that the array could grow beyond its allocated memory block and corrupt the heap. Fixes issue #4127.
2019-08-15esp32/modules: On initial setup mount internal flash at root.Damien George
Like it's done on normal boot up. Fixes issue #5004.
2019-08-15tests/unix: Update extra_coverage expected output with new atexit func.Damien George
2019-08-15docs/pyboard: Emphasize the instructions for making a USB mouse.Vicki Lowe
It wasn't clear why that element was `10` instead of `0`. Also bumped the `10` to `100` to make the mouse movement more obvious.
2019-08-15docs/library: Document that sys.version_info returns a 3-tuple only.Tom McDermott
See issue #4970.
2019-08-15docs/pyboard: Clarify initial files on pyboard and fix up formatting.Vicki Lowe
2019-08-15docs/pyboard: Update name of mounted volume to match code.Vicki Lowe
2019-08-15docs/library/sys: Add documentation for sys.atexit function.Damien George
2019-08-15tests/misc/sys_atexit: Add test for new sys.atexit feature.Milan Rossa
2019-08-15unix: Enable sys.atexit, triggered after the main script ends.Milan Rossa
2019-08-15py: Implement new sys.atexit feature.Milan Rossa
This patch implements a new sys.atexit function which registers a function that is later executed when the main script ends. It is configurable via MICROPY_PY_SYS_ATEXIT, disabled by default. This is not compliant with CPython, rather it can be used to implement a CPython compatible "atexit" module if desired (similar to how sys.print_exception can be used to implement functionality of the "traceback" module).
2019-08-15esp32: Add support for mDNS queries and responder.Damien George
They are both enabled by default, but can be disabled by defining MICROPY_HW_ENABLE_MDNS_QUERIES and/or MICROPY_HW_ENABLE_MDNS_RESPONDER to 0. The hostname for the responder is currently taken from tcpip_adapter_get_hostname() but should eventually be configurable.
2019-08-15stm32/usbd: Make USB device FIFO sizes dynamically configurable.Damien George
Allows to optimise and configure the FIFO sizes depending on the USB device configuration selected at runtime, eg VCP+MSC vs 3xVCP+MSC.
2019-08-15stm32/boards/NUCLEO_L432KC: Add config for USB VCP support.Damien George
2019-08-15stm32/usbd: Support USB device mode on STM32L432 MCUs.Damien George
2019-08-15stm32/usbd: Introduce MICROPY_HW_USB_IS_MULTI_OTG to simplify USB configDamien George
This is an internal config value that is enabled for MCUs that have multiple OTG instances, to simplify #if configuration of the USB code.
2019-08-15stm32/modpyb: Support building with PY_PYB_LEGACY on and HW_USB_HID off.Damien George
2019-08-14esp32/network_ppp: Add authentication support to the PPP interface.Kenta IDA
This commit adds the connect() method to the PPP interface and requires that connect() be called after active(1). This is a breaking change for the PPP API. With the connect() method it's now possible to pass in authentication information for PAP/CHAP, eg: ppp.active(1) ppp.connect(authmode=ppp.AUTH_PAP, username="user", "password="password") If no authentication is needed simply call connect() without any parameters. This will get the original behaviour of calling active(1).
2019-08-08stm32/sdcard: Support configuring the SD/MMC bus width to 1 or 4 bits.Chris Wilson
Some SD/MMC breakout boards don't support 4-bit bus mode. This adds a new macro MICROPY_HW_SDMMC_BUS_WIDTH that allows each board to define the width of the SD/MMC bus interface used on that board, defaulting to 4 bits.
2019-08-06py/showbc: Fix off-by-one when showing address of unknown opcode.Milan Rossa
2019-08-06py: Allow to pass in read-only buffers to viper and inline-asm funcs.Damien George
Fixes #4936.
2019-08-06esp8266/mpconfigport.h: Enable lwIP raw sockets.Damien George
2019-08-06stm32/mpconfigport.h: Enable lwIP raw sockets.Damien George
2019-08-06stm32/lwip_inc: Enable raw socket type.Damien George
2019-08-06extmod/modlwip: Implement raw sockets for lwIP.Damien George
Configurable via MICROPY_PY_LWIP_SOCK_RAW.
2019-07-31docs/library/framebuf: Add missing module reference in example code.Arsenijs
2019-07-31tests: Add tests for overriding builtins.__import__.Damien George
2019-07-31py/modio: Call mp_import_name to do resource stream import.Paul m. p. P
So code is not duplicated and it can take advantage of __import__ being overridden.
2019-07-31py/runtime: Allow to override builtins.__import__ with Python func.Paul m. p. P
This patch adds a simple but powerful hook into the import system, in a CPython compatible way, by allowing to override builtins.__import__. This does introduce some overhead to all imports but it's minor: - the dict lookup of __import__ is bypassed if there are no modifications to the builtins module (which is the case at start up); - imports are not performance critical, usually done just at the start of a script; - compared to how much work is done in an import, looking up a value in a dict is a relatively small additional piece of work.
2019-07-31py/builtinimport: Populate __file__ when importing frozen or mpy files.Paul m. p. P
Note that bytecode already includes the source filename as a qstr so there is no additional memory used by the interning operation here.
2019-07-30esp32/Makefile: Include CFLAGS_EXTRA in CFLAGS definition.Damien George
Following other ports, so builds can be customised more easily, eg on the command line building with a user C-module.
2019-07-30py/objdict: Quote non-string types when used as keys in JSON output.Eric Poulsen
JSON requires that keys of objects be strings. CPython will therefore automatically quote simple types (NoneType, bool, int, float) when they are used directly as keys in JSON output. To prevent subtle bugs and emit compliant JSON, MicroPython should at least test for such keys so they aren't silently let through. Then doing the actual quoting is a similar cost to raising an exception, so that's what is implemented by this patch. Fixes issue #4790.
2019-07-26travis: Build an stm32 board with threading enabled to test it with CI.Damien George
2019-07-26stm32/usbd_hid_interface: Include extra header to build with threading.Damien George
2019-07-25stm32/boards/xxx_WB55: Enable USB HID now that it works on WB MCUs.Damien George
2019-07-25stm32/usbd_hid_interface: Rewrite USB HID interface code.Damien George
The previous version did not work on MCUs that only had USB device mode (compared to OTG) because of the handling of NAK. And this previous handling of NAK had a race condition where a new packet could come in before USBD_HID_SetNAK was called (since USBD_HID_ReceivePacket clears NAK as part of its operation). Furthermore, the double buffering of incoming reports was not working, only one buffer could be used at a time. This commit rewrites the HID interface code to have a single incoming buffer, and only calls USBD_HID_ReceivePacket after the user has read the incoming report (similar to how the VCP does its flow control). As such, USBD_HID_SetNAK and USBD_HID_ClearNAK are no longer needed. API functionality from the user's point of view should be unchanged with this commit.
2019-07-25stm32/dma: Fix re-start of DMA stream by clearing all event flags.Damien George
As per the datasheet, all event flags for a stream must be cleared before enabling it. Fixes issue #4944 (with DAC.write_timed).
2019-07-25py/sequence: Fix grammar in comment about equality.Yonatan Goldschmidt
2019-07-25stm32/boards/NUCLEO_F722ZE: Add definition files for new board.badlyby