summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-10-22py/objexcept: Compare mp_emergency_exception_buf_size signed.Emil Renner Berthing
mp_emergency_exception_buf_size is signed, so let's make sure we compare it as such.
2020-10-22py/scope: Name and use id_kind_type_t.Emil Renner Berthing
The function scope_find_or_add_id used to take a scope_kind_t enum and save it in an uint8_t. Saving an enum in a uint8_t is fine, but everywhere this function is called it is not actually given a scope_kind_t but an anonymous enum instead. Let's give this enum a name and use that as the argument type. This doesn't change the generated code, but is a C type mismatch that unfortunately doesn't show up unless you enable -Wenum-conversion.
2020-10-22docs/reference/glossary.rst: Fix minor grammar error, An -> A.Kevin Thomas
2020-10-22stm32/usbd_cdc_interface: Check and handle CDC TX wrap-overflow.Damien George
If the device is not connected over USB CDC to a host then all output to the CDC (eg initial boot messages) is written to the CDC TX buffer with wrapping, so that the most recent data is retained when the USB CDC is eventually connected (eg so the REPL banner is displayed upon connection). This commit fixes a bug in this behaviour, which was likely introduced in e4fcd216e02eef0b389c84ecd67be3114aac0a5d, where the initial data in the CDC TX buffer is repeated multiple times on first connection of the device to the host. Signed-off-by: Damien George <damien@micropython.org>
2020-10-22stm32: Fix broken build when FAT FS multi-partition is disabled.iabdalkader
2020-10-21esp32/mpconfigport.h: Enable MICROPY_PY_DELATTR_SETATTR.Andrew Leech
To align with unix and stm32 ports.
2020-10-20unix/mpconfigport.h: Enable MICROPY_PY_DELATTR_SETATTR.Andrew Leech
This is a generally useful feature and because it's part of the object model it cannot be added at runtime by some loadable Python code, so enable it on the standard unix build.
2020-10-20docs/library/machine.Timer.rst: Add mention of constructor arguments.Howard Lovatt
2020-10-20docs/library/machine.Signal.rst: Correct typo: usecases to use cases.Howard Lovatt
2020-10-20docs/library/machine.rst: Correct minor typo: timout to timeout.Howard Lovatt
2020-10-20docs/library/btree.rst: Correct method typo: __detitem__ to __delitem__.Howard Lovatt
2020-10-20tools/upip.py: Support explicit port number in host.awachtler
Adding a port number other then 443 to a PyPI URL may be needed if a local server like devpi is used.
2020-10-17ports: Use correct in/out endpoint size in TUD_CDC_DESCRIPTOR.Damien George
The last argument of TUD_CDC_DESCRIPTOR() is the endpoint size (or wMaxPacketSize), not the CDC RX buffer size (which can be larger than the endpoint size). Signed-off-by: Damien George <damien@micropython.org>
2020-10-16stm32/boards/NUCLEO_WB55/rfcore_firmware.py: Increase GET_STATE timeout.Jim Mussared
When installing WS firmware, the very first GET_STATE can take several seconds to respond (especially with the larger binaries like BLE_stack_full). Allows stm.rfcore_sys_hci to take an optional timeout, defaulting to SYS_ACK_TIMEOUT_MS (which is 250ms). Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-10-16stm32/boards/NUCLEO_WB55/rfcore_firmware.py: Fix bad variable name.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-10-16stm32/boards/NUCLEO_WB55/rfcore_firmware.py: Fix flash unlock.Jim Mussared
The flash can sometimes be in an already-unlocked state, and attempting to unlock it again will cause an immediate reset. So make _Flash.unlock() check FLASH_CR_LOCK to get the current state. Also fix some magic numbers for FLASH_CR_LOCK AND FLASH_CR_STRT. The machine.reset() could be removed because it no longer crashes now that the flash unlock is fixed. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-10-10py/objtype: Handle __dict__ attribute when type has no locals.Jim Mussared
2020-10-10py/objdict: Add mp_const_empty_dict_obj, use it for mp_const_empty_map.Jim Mussared
2020-10-09stm32/rfcore: Update to support WS=1.9.0.0.4.Jim Mussared
This WS update to 1.9.0.0.4 broke the workaround used in rfcore for OCF_CB_SET_EVENT_MASK2, so fix it to support WS 1.8 and 1.9.
2020-10-08stm32/boards/NUCLEO_WB55: Add standalone WB55 FUS/WS firmware updater.Jim Mussared
This commit adds a script that can be run on-device to install FUS and WS binaries from the filesystem. Instructions for use are provided in the rfcore_firmware.py file. The commit also removes unneeded functionality from the existing rfcore.py debug script (and renames it rfcore_debug.py).
2020-10-08stm32/rfcore: Add Python API for basic rfcore operations.Jim Mussared
The new functions provide FUS/WS status, version and SYS HCI commands: - stm.rfcore_status() - stm.rfcore_fw_version(fw_id) - stm.rfcore_sys_hci(ogf, ocf, cmd)
2020-10-06stm32/sdcard: Fix H7 build when using SDMMC2.iabdalkader
Changes are: - Fix missing IRQ handler when SDMMC2 is used instead of SDMMC1 with H7 MCUs. - Removed outdated H7 series compatibility macros. - Defined common IRQ handler macro for F4 series.
2020-10-06stm32/sdio: Don't change any DMA2 settings on H7 MCUs.iabdalkader
DMA2 clock and registers should be left in their current state in the H7 build.
2020-10-06esp32: Use path relative to root for netutils/timeutils headers.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-10-02stm32/Makefile: Allow boards to extend SRC_C, SRC_O and OBJ variables.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-10-01unix/variants: Enable MICROPY_DEBUG_PARSE_RULE_NAME on coverage build.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-10-01py/parse: Expose rule-name printing as MICROPY_DEBUG_PARSE_RULE_NAME.Damien George
So it can be enabled without modifying the source. Signed-off-by: Damien George <damien@micropython.org>
2020-10-01extmod/utime_mphal: Add generic utime.time_ns() function.Damien George
It requires mp_hal_time_ns() to be provided by a port. This function allows very accurate absolute timestamps. Enabled on unix, windows, stm32, esp8266 and esp32. Signed-off-by: Damien George <damien@micropython.org>
2020-10-01unix,windows: Implement mp_hal_time_ns using gettimeofday.Damien George
This provides microsecond accuracy. Signed-off-by: Damien George <damien@micropython.org>
2020-10-01docs: Update I2C and SPI docs to add reference to SoftI2C and SoftSPI.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-10-01ports: Support legacy soft I2C/SPI construction via id=-1 arg.Damien George
With a warning that this way of constructing software I2C/SPI is deprecated. The check and warning will be removed in a future release. This should help existing code to migrate to the new SoftI2C/SoftSPI types. Signed-off-by: Damien George <damien@micropython.org>
2020-10-01ports: Add SoftI2C and SoftSPI to machine module where appropriate.Damien George
Previous commits removed the ability for one I2C/SPI constructor to construct both software- or hardware-based peripheral instances. Such construction is now split to explicit soft and non-soft types. This commit makes both types available in all ports that previously could create both software and hardware peripherals: machine.I2C and machine.SPI construct hardware instances, while machine.SoftI2C and machine.SoftSPI create software instances. This is a breaking change for use of software-based I2C and SPI. Code that constructed I2C/SPI peripherals in the following way will need to be changed: machine.I2C(-1, ...) -> machine.SoftI2C(...) machine.I2C(scl=scl, sda=sda) -> machine.SoftI2C(scl=scl, sda=sda) machine.SPI(-1, ...) -> machine.SoftSPI(...) machine.SPI(sck=sck, mosi=mosi, miso=miso) -> machine.SoftSPI(sck=sck, mosi=mosi, miso=miso) Code which uses machine.I2C and machine.SPI classes to access hardware peripherals does not need to change. Signed-off-by: Damien George <damien@micropython.org>
2020-10-01extmod/machine_spi: Remove "id" arg in SoftSPI constructor.Damien George
The SoftSPI constructor is now used soley to create SoftSPI instances, it can no longer delegate to create a hardware-based SPI instance. Signed-off-by: Damien George <damien@micropython.org>
2020-10-01extmod/machine_i2c: Remove "id" arg in SoftI2C constructor.Damien George
The SoftI2C constructor is now used soley to create SoftI2C instances, it can no longer delegate to create a hardware-based I2C instance. Signed-off-by: Damien George <damien@micropython.org>
2020-10-01extmod/machine_i2c: Rename type to SoftI2C and add custom print method.Damien George
Also rename machine_i2c_type to mp_machine_soft_i2c_type. These changes make it clear that it's a soft-I2C implementation, and match SoftSPI. Signed-off-by: Damien George <damien@micropython.org>
2020-10-01py/makeversionhdr.py: Match only git tags which look like versions.Mike Wadsten
Some downstream projects may use tags in their repositories for more than just designating MicroPython releases. In those cases, the makeversionhdr.py script would end up using a different tag than intended. So tell `git describe` to only match tags that look like a MicroPython version tag, such as `v1.12` or `v2.0`.
2020-09-30docs/reference/packages.rst: Fix typo, remove duplicate "port".David Lechner
Fixes #6485.
2020-09-30zephyr: Update build instructions to v2.4.0.Maureen Helm
Updates the zephyr port build instructions to use the latest zephyr release tag. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-30travis: Update zephyr build to v2.4.0.Maureen Helm
Updates CI to use the latest zephyr release tag. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-30zephyr: Const-ify struct device instance pointers.Maureen Helm
Zephyr v2.4.0 added a const qualifier to usages of struct device to allow storing device driver instances exclusively in flash and thereby reduce ram footprint. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-30zephyr: Replace zephyr integer types with C99 types.Maureen Helm
Zephyr v2.4.0 stopped using custom integer types in favor of C99 types instead. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-30extmod/modure: Allow \\ in re.sub replacements.Andrew Leech
2020-09-26examples/bluetooth: Update to use positional-only args to irq().Jim Mussared
To match 6a6a5f9e151473bdcc1d14725d680691ff665a82.
2020-09-25tests/run-tests: Use -BS flags when running CPython.Damien George
The use of -S ensures that only the CPython standard library is accessible, which makes tests run the same regardless of any site-packages that are installed. It also improves start-up time of CPython, reducing the overall time spent running the test suite. tests/basics/containment.py is updated to work around issue with old Python versions not being able to str-format a dict-keys object, which becomes apparent when -S is used. Signed-off-by: Damien George <damien@micropython.org>
2020-09-25docs/develop: Add notes on prerequisite tools for building native .mpy.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-25extmod/modbluetooth: Change module-owned bytes objects to memoryview.Damien George
A read-only memoryview object is a better representation of the data, which is owned by the ubluetooth module and may change between calls to the user's irq callback function. Signed-off-by: Damien George <damien@micropython.org>
2020-09-25py/objarray.h: Add mp_obj_memoryview_init() helper function.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-24py/objstr: Make bytes(bytes_obj) return bytes_obj.Iyassou Shimels
Calling the bytes constructor on a bytes object returns the original bytes object. This saves allocating a new instance, and matches CPython. Signed-off-by: Iyassou Shimels <s.iyassou@gmail.com>
2020-09-23windows: Update build instructions in README.stijn
Make the instructions more complete by documenting all needed steps for starting from scratch. Also add a section for MSYS2 since the Travis build uses it as well and it's a good alternative for Cygwin. Remove the mingw32 reference since it's not readily available anymore in most Linux distros nor compiles successfully.
2020-09-23extmod/vfs: Fix lookup of entry in root dir so it fails correctly.Damien George
Prior to this commit, uos.chdir('/') followed by uos.stat('noexist') would succeed that stat even though the entry did not exist (some other functions like listdir would have similar issues). This is because, if the current directory was the root and the path was relative, mp_vfs_lookup_path would return success for bad paths. Signed-off-by: Damien George <damien@micropython.org>