Commit Graph

4 Commits

Author SHA1 Message Date
Damien George bffb71f523 stm32/mpbthciport: Only init the uart once, then use uart_set_baudrate.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-14 18:32:05 +11:00
Jim Mussared 61d1e4b01b extmod/nimble: Make stm32 and unix NimBLE ports use synchronous events.
This changes stm32 from using PENDSV to run NimBLE to use the MicroPython
scheduler instead.  This allows Python BLE callbacks to be invoked directly
(and therefore synchronously) rather than via the ringbuffer.

The NimBLE UART HCI and event processing now happens in a scheduled task
every 128ms.  When RX IRQ idle events arrive, it will also schedule this
task to improve latency.

There is a similar change for the unix port where the background thread now
queues the scheduled task.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13 17:19:05 +11:00
Andrew Leech 6077c63a45 stm32/mpbthciport: Increase char timeout of BT HCI UART.
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-08 12:53:24 +10:00
Jim Mussared ed14435a8e extmod/modbluetooth: Refactor stack/hci/driver/port bindings.
Previously the interaction between the different layers of the Bluetooth
stack was different on each port and each stack.  This commit defines
common interfaces between them and implements them for cyw43, btstack,
nimble, stm32, unix.
2020-09-08 11:41:31 +10:00