summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-06-23esp32/modesp32: Add wake_on_ulp() so ULP can wake CPU from deepsleep.Christian Walther
Add esp32.wake_on_ulp() to give access to esp_sleep_enable_ulp_wakeup(), which is needed to allow the ULP co-processor to wake the main CPU from deep sleep.
2022-06-23esp32/boards: Increase 512 bytes limit on ULP programs to 2040.Christian Walther
Allow esp32.ULP.load_binary() to use the maximum amount of memory available again, which is 2040 bytes unless MICROPY_HW_RTC_USER_MEM_MAX is customized. This value regressed in 3d49b157b89a59774fc4958dcaacd2c96ba6eaa4
2022-06-23esp32/machine_uart: Implement the functionality of timeout_char arg.robert-hh
Using it for the rx-timeout. The value is given as ms, which is then converted to character times. A value of less than a character time will cause the rx call to return immediately after 1 character, which may be inefficient at high transmission rates. Addresses #8778.
2022-06-23nrf: Enable optional support for Arduino 1200bps touch.iabdalkader
Individual boards must enable it via MICROPY_HW_USB_CDC_1200BPS_TOUCH.
2022-06-23rp2/boards/ARDUINO_NANO_RP2040_CONNECT: Enable Arduino 1200bps touch.iabdalkader
2022-06-23shared/runtime/tinyusb_helpers: Add TinyUSB helper functions.iabdalkader
Currently this file only includes a CDC jump-to-bootloader helper function.
2022-06-23stm32/usbd_cdc_interface: Add support for Arduino 1200bps touch.iabdalkader
If the serial port is closed with baudrate at 1200 then the board will enter its bootloader.
2022-06-23esp8266/mpconfigport: Disable MICROPY_PY_UTIMEQ.Damien George
This is no longer needed with new uasyncio v3, and disabling it saves 900 bytes. Signed-off-by: Damien George <damien@micropython.org>
2022-06-23esp8266/mpconfigport: Switch to ROM feature level configuration.Damien George
This is a no-op in terms of board configuration. Signed-off-by: Damien George <damien@micropython.org>
2022-06-23py/parsenum: Optimise when building with complex disabled.Damien George
To reduce code size when MICROPY_PY_BUILTINS_COMPLEX is disabled. Signed-off-by: Damien George <damien@micropython.org>
2022-06-23py/parsenum: Fix parsing of complex "j" and also "nanj", "infj".Damien George
Prior to this commit, complex("j") would return 0j, and complex("nanj") would return nan+0j. This commit makes sure "j" is tested for after parsing the number (nan, inf or a decimal), and also supports the case of "j" on its own. Signed-off-by: Damien George <damien@micropython.org>
2022-06-23py/parsenum: Support parsing complex numbers of the form "a+bj".Jim Mussared
To conform with CPython. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-06-21docs/library/uasyncio: Consistently use "uasyncio" instead of "asyncio".Luiz Brandao
2022-06-21docs/library/machine: Add note on interrupts being critical to system.Patrick Joy
2022-06-21docs: Set LaTeX engine to XeLaTeX for PDF generation.Stewart C. Russell
Also added to suggested packages list for PDF build. See comment in Sphinx project for (some) details: https://github.com/sphinx-doc/sphinx/pull/5693#pullrequestreview-180444650
2022-06-21docs/library: Remove unnecessary "pyb." prefix on class names.Damien George
Otherwise these classes are refered to with a double prefix, like pyb.pyb.ADC. Signed-off-by: Damien George <damien@micropython.org>
2022-06-21docs/library/pyb.Timer: Document `brk` argument and its constants.Howard Lovatt
2022-06-21extmod/modbtree: Use buffer protocol for keys/values.David Lechner
This changes the btree implementation to use the buffer protocol for reading key/values in all methods. `str` and `bytes` objects are not the only bytes-like objects that could be used. Documentation and tests are also updated. Addresses issue #8748. Signed-off-by: David Lechner <david@pybricks.com>
2022-06-21extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk.David Lechner
This separates extmod source files from `py.mk`. Previously, `py.mk` assumed that every consumer of the py/ directory also wanted to include extmod/. However, this is not the case. For example, building mpy-cross uses py/ but doesn't need extmod/. This commit moves all extmod-specific items from `py.mk` to `extmod.mk` and explicitly includes `extmod.mk` in ports that use it. Signed-off-by: David Lechner <david@pybricks.com>
2022-06-20extmod/extmod.cmake: Only include modbtree in build if it's enabled.Damien George
Following how it's done in extmod.mk. Signed-off-by: Damien George <damien@micropython.org>
2022-06-20extmod/modlwip: Clean up inclusion of modlwip in build process.Damien George
The following changes are made: - Guard entire file with MICROPY_PY_LWIP, so it can be included in the build while still being disabled (for consistency with other extmod modules). - Add modlwip.c to list of all extmod source in py/py.mk and extmod/extmod.cmake so all ports can easily use it. - Move generic modlwip GIT_SUBMODULES build configuration code from ports/rp2/CMakeLists.txt to extmod/extmod.cmake, so it can be reused by other ports. - Remove now unnecessary inclusion of modlwip.c in EXTMOD_SRC_C in esp8266 port, and in SRC_QSTR in mimxrt port. Signed-off-by: Damien George <damien@micropython.org>
2022-06-20stm32/Makefile: Set CSUPEROPT to -Os for F0 and G0 MCUs to save space.Damien George
Saves 1804 bytes on NUCLEO_F091RC, and 1080 bytes on NUCLEO_G0B1RE. Signed-off-by: Damien George <damien@micropython.org>
2022-06-20py/objcell: Make cell get/set funcs static-inline to reduce code size.Damien George
Change in code size is: bare-arm: -36 -0.062% minimal x86: -92 -0.056% unix x64: -72 -0.014% unix nanbox: -276 -0.060% stm32: +0 +0.000% PYBV10 stm32: -40 +0.021% NUCLEO_L073RZ cc3200: -16 -0.009% esp8266: +176 +0.025% GENERIC esp32: -28 -0.002% GENERIC mimxrt: -56 -0.016% TEENSY40 renesas-ra: +0 +0.000% RA6M2_EK nrf: +0 +0.000% pca10040 rp2: -64 -0.013% PICO samd: -32 -0.023% ADAFRUIT_ITSYBITSY_M4_EXPRESS Ports like stm32 that build the VM with -O3 have no change because the savings from the inlining are offset by additional gcc performance optimisations in the VM. Signed-off-by: Damien George <damien@micropython.org>
2022-06-20py/emit: Suppress unreachable bytecode/native code that follows jump.Damien George
This new logic tracks when an unconditional jump/raise occurs in the emitted code stream (bytecode or native machine code) and suppresses all subsequent code, until a label is assigned. This eliminates a lot of cases of dead code, with relatively simple logic. This commit combined with the previous one (that removed the existing dead-code finding logic) has the following code size change: bare-arm: -16 -0.028% minimal x86: -60 -0.036% unix x64: -368 -0.070% unix nanbox: -80 -0.017% stm32: -204 -0.052% PYBV10 cc3200: +0 +0.000% esp8266: -232 -0.033% GENERIC esp32: -224 -0.015% GENERIC[incl -40(data)] mimxrt: -192 -0.054% TEENSY40 renesas-ra: -200 -0.032% RA6M2_EK nrf: +28 +0.015% pca10040 rp2: -256 -0.050% PICO samd: -12 -0.009% ADAFRUIT_ITSYBITSY_M4_EXPRESS Signed-off-by: Damien George <damien@micropython.org>
2022-06-20py/emit: Remove logic to detect last-emit-was-return-value.Damien George
This optimisation to remove dead code is not as good as it could be. Signed-off-by: Damien George <damien@micropython.org>
2022-06-20py/vm: Change comparison for finally handler search from > to >=.Damien George
The search in these cases should include all finally handlers that are after the current ip. If a handler starts at exactly ip then it is considered "after" the ip. This can happen when END_FINALLY is followed immediately by a finally handler (from a different finally). Consider the function: def f(): try: return 0 finally: print(1) The current bytecode emitter generates the following code: 00 SETUP_FINALLY 5 02 LOAD_CONST_SMALL_INT 0 03 RETURN_VALUE 04 LOAD_CONST_NONE **** 05 LOAD_GLOBAL print 07 LOAD_CONST_SMALL_INT 1 08 CALL_FUNCTION n=1 nkw=0 10 POP_TOP 11 END_FINALLY 12 LOAD_CONST_NONE 13 RETURN_VALUE The LOAD_CONST_NONE marked with **** is dead code because it follows a RETURN_VALUE, and nothing jumps to this LOAD_CONST_NONE. If the emitter could remove this this dead code it would produce: 00 SETUP_FINALLY 4 02 LOAD_CONST_SMALL_INT 0 03 RETURN_VALUE 04 LOAD_GLOBAL print 06 LOAD_CONST_SMALL_INT 1 07 CALL_FUNCTION n=1 nkw=0 09 POP_TOP 10 END_FINALLY 11 LOAD_CONST_NONE 12 RETURN_VALUE In this case the finally block (which starts at offset 4) immediately follows the RETURN_VALUE. When RETURN_VALUE executes ip will point to offset 4 in the bytecode (because the dispatch of the opcode does *ip++) and so the finally handler will only be found if a >= comparison is used. It's a similar story for break/continue: while True: try: break finally: print(1) Although technically in this case the > comparison still works because the extra byte from the UNWIND_JUMP (encoding the number of exception handlers to unwind) doesn't have a *ip++ (just a *ip) so ip remains pointing within the UNWIND_JUMP opcode, and not at the start of the following finally handler. Nevertheless, the change is made to use >= for consistency with the RETURN_VALUE change. Signed-off-by: Damien George <damien@micropython.org>
2022-06-20github/ISSUE_TEMPLATE: Make minor improvements to placeholder text.Jim Mussared
Move the "delete placeholder" to the end, so it's not the first thing the reader does. And add extra text calling out "how do I?" questions. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-06-17docs: Update to use new WLAN argument names for ssid/security/key.iabdalkader
Addresses issue #8083.
2022-06-17esp8266/modnetwork: Rename WLAN keyword args to ssid/security/key.iabdalkader
The WLAN.config() method now supports "ssid", "security" and "key" as aliases to the existing "essid", "authmode" and "password", which are now deprecated. The help text and setup helper are also updated. Addresses issue #8083.
2022-06-17esp32/network_wlan: Rename WLAN keyword args to ssid/security/key.iabdalkader
The WLAN.config() method now supports "ssid", "security" and "key" as aliases to the existing "essid", "authmode" and "password", which are now deprecated. Addresses issue #8083.
2022-06-17extmod/network_ninaw10: Rename WLAN connect argument from essid to ssid.iabdalkader
Addresses issue #8083.
2022-06-17extmod/network_cyw43: Rename WLAN keyword args to ssid/security/key.iabdalkader
Rename WLAN keyword args to scan(), connect() and config() to be more consistent across ports and WLAN drivers. This change is backwards compatible and will support obsolete keyword args, except for positional "essid" which is now deprecated in favor of "ssid". The changed argument names are - "essid" changed to "ssid" - "auth" or "authmode" changed to "security" - "password" changed to "key" Addresses issue #8083.
2022-06-17stm32/boards/NUCLEO_F091RC: Enable LFS1 filesystem.chrismas9
And disable some less common features to make space for it. Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2022-06-17stm32/boards/stm32f091xc.ld: Allocate space for a small filesystem.chrismas9
Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2022-06-17tools/ci.sh: Drop ppa requirement for code formatting CI.David Lechner
The CI scripts were using a PPA to get a backported version of uncrustify on Ubuntu 20.04. However, this causes CI to intermittently fail due to connection issues to launchpad.net or the key server. Ubuntu 22.04 has a newer version of uncrustify removing the need for the PPA. Ubuntu 22.04 is now in beta on GitHub actions, so it can be used. Signed-off-by: David Lechner <david@pybricks.com>
2022-06-17zephyr: Upgrade to Zephyr v3.1.0.Maureen Helm
Updates the Zephyr port build instructions and CI to use the latest Zephyr release tag. Tested on frdm_k64f. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-06-17zephyr: Update include paths to use the zephyr namespace.Maureen Helm
Zephyr v3.1.0 moved all public headers to include/zephyr. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-06-17renesas-ra/machine_i2c: Remove unnecessary start/stop dummy functions.Damien George
The code in extmod/machine_i2c.c will check for NULL slots and raise an appropriate exception. Signed-off-by: Damien George <damien@micropython.org>
2022-06-17tools/metrics.py: Add mimxrt and renesas-ra to list of available ports.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-17stm32/modmachine: Factor out mboot enter code to a function.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-17renesas-ra/modmachine: Allow boards to provide custom bootloader code.iabdalkader
And expose the machine_bootloader() C function so it can be used elsewhere.
2022-06-17rp2/modmachine: Allow boards to provide custom bootloader code.iabdalkader
And expose the machine_bootloader() C function so it can be used elsewhere.
2022-06-17nrf/modmachine: Add machine.bootloader() and make it customisable.iabdalkader
2022-06-17stm32/modmachine: Allow boards to provide custom bootloader code.iabdalkader
And expose the machine_bootloader() C function so it can be used elsewhere.
2022-06-17nrf/main: Add startup and early-init board hook macros.iabdalkader
Following stm32 for naming and location of the hooks. Also allow a board to provide custom .c files to implement code for these hooks.
2022-06-17all: Bump version to 1.19.1.v1.19.1Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-17extmod/machine_i2c: Only use WRITE1 option if transfer supports it.Damien George
When MICROPY_PY_MACHINE_I2C_TRANSFER_WRITE1 is enabled the port's hardware I2C transfer functions should support the MP_MACHINE_I2C_FLAG_WRITE1 option, but software I2C will not. So add a flag to the I2C protocol struct so each individual protocol can indicate whether it supports this option or not. Fixes issue #8765. Signed-off-by: Damien George <damien@micropython.org>
2022-06-16all: Bump version to 1.19.v1.19Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-16stm32/mboot: Only include UI code if at least one board LED is defined.Damien George
Otherwise the board must provide dummy definitions of MBOOT_LED1. Signed-off-by: Damien George <damien@micropython.org>
2022-06-15zephyr/modusocket: Fix function object wrapper for listen method.Damien George
This was missed by 919f696ad254bcc39effe7ce7fddae8cf406c954 Signed-off-by: Damien George <damien@micropython.org>