mimxrt/mpbthciport: Allow disabling UART flow control for BLE.

Not all boards or BLE extensions have the flow control signals for BLE
available at suitable pins.  Actually none of the Adafruit extensions
match for flow control.

For consistency with the previous behaviour it is enabled by default.

Signed-off-by: robert-hh <robert@hammelrath.com>
This commit is contained in:
robert-hh 2023-09-30 08:27:22 +02:00 committed by Damien George
parent 51ca23e463
commit 6482eb142c
1 changed files with 5 additions and 1 deletions

View File

@ -36,6 +36,10 @@
#if MICROPY_PY_BLUETOOTH
#ifndef MICROPY_HW_BLE_UART_FLOW_CONTROL
#define MICROPY_HW_BLE_UART_FLOW_CONTROL (3)
#endif
#define DEBUG_printf(...) // mp_printf(&mp_plat_print, "mpbthciport.c: " __VA_ARGS__)
#define ERROR_printf(...) mp_printf(&mp_plat_print, "mpbthciport.c: " __VA_ARGS__)
@ -85,7 +89,7 @@ int mp_bluetooth_hci_uart_init(uint32_t port, uint32_t baudrate) {
mp_obj_t args[] = {
MP_OBJ_NEW_SMALL_INT(port),
MP_OBJ_NEW_QSTR(MP_QSTR_baudrate), MP_OBJ_NEW_SMALL_INT(baudrate),
MP_OBJ_NEW_QSTR(MP_QSTR_flow), MP_OBJ_NEW_SMALL_INT(3),
MP_OBJ_NEW_QSTR(MP_QSTR_flow), MP_OBJ_NEW_SMALL_INT(MICROPY_HW_BLE_UART_FLOW_CONTROL),
MP_OBJ_NEW_QSTR(MP_QSTR_timeout), MP_OBJ_NEW_SMALL_INT(200),
MP_OBJ_NEW_QSTR(MP_QSTR_timeout_char), MP_OBJ_NEW_SMALL_INT(200),
MP_OBJ_NEW_QSTR(MP_QSTR_txbuf), MP_OBJ_NEW_SMALL_INT(768),