aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-09-18travis: Install setuptools for black code formatting.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-18tests/multi_bluetooth/ble_mtu.py: Add multitest for BLE MTU.Jim Mussared
2020-09-18tests/run-multitests.py: Show test/truth diff.Jim Mussared
2020-09-18extmod/modbluetooth: Implement MTU.Jim Mussared
2020-09-18docs/library/ubluetooth.rst: Add docs for MTU API.Jim Mussared
2020-09-18tests/multi_bluetooth: Update UUID format in .exp files.Jim Mussared
2020-09-15docs/library/ubluetooth.rst: Clarify peripheral/central vs server/clientJim Mussared
Previously this documentation assumed peripheral=server and central=client, but this is not accurate or true to the implementation.
2020-09-15extmod/modbluetooth: Print UUIDs correctly.Jim Mussared
In particular, the printed string can now be re-evaluated to construct the same UUID object.
2020-09-15docs/library/ubluetooth.rst: Clarify position/kw arguments.Jim Mussared
Almost all ubluetooth functions are positional-only, but some have optional args. Make this clearer and show what the defaults are.
2020-09-15extmod/modbluetooth: Make BLE.irq() method positional only.Jim Mussared
Simplifcation now that the trigger arg has been removed.
2020-09-15extmod/modbluetooth: Fix handling of optional data/uuid args.Jim Mussared
For the following 3 functions, previously the code relied on whether the arg was passed at all, to make it optional. Now it allows them to be explicitly `None` to indicate they are not used: - gatts_notify(..., [data]) - gattc_discover_services(..., [uuid]) - gattc_discover_characteristics(..., [uuid]) Also ensure that the uuid arguments are actually instances of the uuid type, and fix handling of the 5th arg in gattc_discover_characteristics().
2020-09-12stm32/servo: Fix angle and speed methods to work again with -ve args.Damien George
Fixes a regression introduced by 70affd9ba22e7f62666a9a2fafc2a3c0be9ef95a Fixes issue #6403 Signed-off-by: Damien George <damien@micropython.org>
2020-09-11py/parse: Pass in an mp_print_t to mp_parse_node_print.Damien George
So the output can be redirected if needed. Signed-off-by: Damien George <damien@micropython.org>
2020-09-11py/showbc: Pass in an mp_print_t struct to all bytecode-print functions.Damien George
So the output can be redirected if needed. Signed-off-by: Damien George <damien@micropython.org>
2020-09-11esp32/mpconfigport.h: Remove duplicate uhashlib registration.Jim Mussared
2020-09-11windows: Show test failures in the Appveyor builds.stijn
2020-09-11windows/Makefile: Support freezing modules.stijn
Alter the build flags as needed to support freezing modules with a manifest. This makes freezing works just like it does for e.g. the unix port.
2020-09-11windows/msvc: Support freezing modules.stijn
Support freezing modules via manifest.py for consistency with the other ports. In essence this comes down to calling makemanifest.py and adding the resulting .c file to the build. Note the file with preprocessed qstrs has been renamed to match what makemanifest.py expects and which is also the name all other ports use.
2020-09-11tools: Write msvc-compatible frozen content.stijn
The msvc compiler doesn't accept zero-sized arrays so let the freezing process generate compatible C code in case no modules are found and the involved arrays are all empty. This doesn't affect the functionality in any way because those arrays only get accessed when mp_frozen_mpy_names contains names, i.e. when modules are actually found.
2020-09-11extmod/modussl_axtls: Reduce size of code that makes exception.Damien George
Change in code size (for ports that use axtls) is: unix x64: -152 -0.030% [incl -160(data)] unix nanbox: -112 -0.025% [incl -96(data)] esp8266: -64 -0.009% GENERIC Signed-off-by: Damien George <damien@micropython.org>
2020-09-11py: Fix handling of NaN in certain pow implementations.stijn
Adds a new compile-time option MICROPY_PY_MATH_POW_FIX_NAN for use with toolchains that don't handle pow-of-NaN correctly.
2020-09-11py/objfloat: Fix handling of negative float to power of nan.Damien George
Prior to this commit, pow(-2, float('nan')) would return (nan+nanj), or raise an exception on targets that don't support complex numbers. This is fixed to return simply nan, as CPython does. Signed-off-by: Damien George <damien@micropython.org>
2020-09-10stm32/rtc.h: Include py/obj.h to make header self contained.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-10stm32/usb: Don't nul pyb_hid_report_desc if MICROPY_HW_USB_HID disabled.Damien George
So this code can be used if pyb_hid_report_desc is not included in the port's root pointer list. Signed-off-by: Damien George <damien@micropython.org>
2020-09-09nrf: Remove unnecessary includes of mpconfigport.h and its header guard.Damien George
The mpconfigport.h file is an internal header and should only ever be included once by mpconfig.h. Signed-off-by: Damien George <damien@micropython.org>
2020-09-09nrf/main: Make mp_builtin_open signature match that in py/builtin.h.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-09tools/mpy-tool.py: Fix merge of multiple mpy files to POP_TOP correctly.Damien George
MP_BC_CALL_FUNCTION will leave the result on the Python stack, so that result must be discarded by MP_BC_POP_TOP. Signed-off-by: Damien George <damien@micropython.org>
2020-09-09mimxrt/boards: Add MIMXRT1064_EVK board.Albort Xue
2020-09-08stm32/boards/NUCLEO_WB55: Add Python helper code for rfcore.Jim Mussared
This allows prototyping rfcore.c improvements from Python. This was mostly written by @dpgeorge with small modifications to work after rfcore_init() by @jimmo.
2020-09-08stm32/rfcore: Enable RX IRQ on BLE IPCC channel for better performance.Jim Mussared
Before this change there was up to a 128ms delay on incoming payloads from CPU2 as it was polled by SysTick. Now the RX IRQ immediately schedules the PendSV.
2020-09-08stm32/rfcore: Refactor some helper funcs, and remove some magic numbers.Jim Mussared
Also explain what the payload fixup code is doing.
2020-09-08stm32/rfcore: Fix length matching in HCI parser.Jim Mussared
2020-09-08tests/multi_bluetooth: Make ble_gap_connect robust against event timing.Jim Mussared
2020-09-08stm32/powerctrlboot: Acquire HSEM5 on STM32WB during SystemClock_Config.Jim Mussared
This is required to allow using WS firmware newer than 1.1.1 concurrently with USB (e.g. USB VCP). It prevents CPU2 from modifying the CLK48 config on boot. Tested on WS=1.8 FUS=1.1. See AN5289 and https://github.com/micropython/micropython/issues/6316
2020-09-08stm32/boards/USBDONGLE_WB55: Add USE_MBOOT support.Jim Mussared
2020-09-08stm32/rfcore: Update rfcore.c to match how ST examples work.Jim Mussared
- Split tables and buffers into SRAM2A/2B. - Use structs rather than word offsets to access tables. - Use FLASH_IPCCDBA register value rather than option bytes directly.
2020-09-08stm32/make-stmconst.py: Add support for WB55 header files.Jim Mussared
2020-09-08extmod/nimble: Add timeout for HCI sync on startup.Jim Mussared
This allows `ble.active(1)` to fail correctly if the HCI controller is unavailable. It also avoids an infine loop in the NimBLE event handler where NimBLE doesn't correctly detect that the HCI controller is unavailable and keeps trying to reset. Furthermore, it fixes an issue where GATT service registrations were left allocated, which led to a bad realloc if the stack was activated multiple times.
2020-09-08esp32: Pin MicroPython and NimBLE tasks to core 0.Jim Mussared
MicroPython and NimBLE must be on the same core, for synchronisation of the BLE ringbuf and the MicroPython scheduler. However, in the current IDF versions (3.3 and 4.0) there are issues (see e.g. #5489) with running NimBLE on core 1. This change - pinning both tasks to core 0 - makes it possible to reliably run the BLE multitests on esp32 boards.
2020-09-08extmod/btstack: Detect HCI UART init failure.Jim Mussared
2020-09-08stm32/mpbthciport: Increase char timeout of BT HCI UART.Andrew Leech
The 2ms used previously was not long enough and it could lose HCI sync. Also print error on tx failure to make this more obvious in the future.
2020-09-08extmod/btstack: Add btstack support for _IRQ_GATTS_READ_REQUEST.Andrew Leech
2020-09-08extmod/modbluetooth: Allow using mp_hal_get_mac as a static address.Jim Mussared
Generally a controller should either have its own public address hardcoded, or loaded by the driver (e.g. cywbt43). However, for a controller that has no public address where you still want a long-term stable address, this allows you to use a static address generated by the port. Typically on STM32 this will be an LAA, but a board might override this.
2020-09-08docs/library/ubluetooth.rst: Document BLE address modes.Jim Mussared
2020-09-08tests/multi_bluetooth: Update to new config('mac') behaviour.Jim Mussared
2020-09-08extmod/modbluetooth: Implement configuration of address modes.Jim Mussared
Changes `BLE.config('mac')` to return a tuple (addr_mode, addr). Adds `BLE.config(addr_mode=...)` to set the addressing mode.
2020-09-08unix: Implement BLE H4 HCI UART for btstack/nimble.Jim Mussared
This commit adds support for using Bluetooth on the unix port via a H4 serial interface (distinct from a USB dongle), with both BTstack and NimBLE Bluetooth stacks. Note that MICROPY_PY_BLUETOOTH is now disabled for the coverage variant. Prior to this commit Bluetooth was anyway not being built on Travis because libusb was not detected. But now that bluetooth works in H4 mode it will be built, and will lead to a large decrease in coverage because Bluetooth tests cannot be run on Travis.
2020-09-08unix/Makefile: Always enable -f*-sections regardless of DEBUG setting.Jim Mussared
2020-09-08extmod/nimble: Implement NimBLE mutex.Jim Mussared
2020-09-08extmod/nimble: Make nimble_malloc work with allocated size.Jim Mussared