aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2019-07-25stm32/boards/stm32f722.ld: Provide memory regions for internal FS.badlyby
2019-07-25stm32/flashbdev: Support internal filesystem on STM32F722/23/32/33.badlyby
2019-07-25tools/pyboard.py: Add filesystem commands to ls/cat/cp/rm remote files.Damien George
Use "-f" to select filesystem mode, followed by the command to execute. Optionally put ":" at the start of a filename to indicate that it's on the remote device, if it would otherwise be ambiguous. Examples: $ pyboard.py -f ls $ pyboard.py -f cat main.py $ pyboard.py -f cp :main.py . # get from device $ pyboard.py -f cp main.py : # put to device $ pyboard.py -f rm main.py
2019-07-25esp32: Pin MicroPython tasks to a specific core.Amir Gonnen
On this port the GIL is enabled and everything works under the assumption of the GIL, ie that a given task has exclusive access to the uPy state, and any ISRs interrupt the current task and therefore the ISR inherits exclusive access to the uPy state for the duration of its execution. If the MicroPython tasks are not pinned to a specific core then an ISR may be executed on a different core to the task, making it possible for the main task and an ISR to execute in parallel, breaking the assumption of the GIL. The easiest and safest fix for this is to pin all MicroPython related code to the same CPU core, as done by this patch. Then any ISR that accesses MicroPython state must be registered from a MicroPython task, to ensure it is invoked on the same core. See issue #4895.
2019-07-20esp32/Makefile: Simplify include of IDF source by using wildcards.Damien George
2019-07-20esp32/Makefile: Put OBJ and LIB rule additions in gen_espidf_lib_rule.Damien George
2019-07-20esp32/Makefile: Fix path expansion for ESPIDF_DRIVER_O.Jim Mussared
It was using subst to s/.c/.o/ which changed .c anywhere in the path.
2019-07-19windows/mpconfigport.h: Don't define restrict/inline/alignof for C++.stijn
The C++ standard forbids redefining keywords, like inline and alignof, so guard these definitions to avoid that, allowing to include the MicroPython headers by C++ code.
2019-07-19esp32: Add support for hardware I2C.Damien George
2019-07-19tests/run-perfbench.py: Add --emit option to select emitter for tests.Damien George
2019-07-17stm32/boards/USBDONGLE_WB55: Add definition files for new board.Damien George
2019-07-17stm32/boards/NUCLEO_WB55: Add definition files for new board.Damien George
2019-07-17stm32/boards: Add MCU support files for STM32WB55.Damien George
2019-07-17stm32: Add initial support for STM32WBxx MCUs.Damien George
This new series of MCUs is similar to the L4 series with an additional Cortex-M0 coprocessor. The firmware for the wireless stack must be managed separately and MicroPython does not currently interface to it. Supported features so far include: RTC, UART, USB, internal flash filesystem.