summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-02-21 11:49:06 +1100
committerDamien George <damien@micropython.org>2024-02-21 11:57:17 +1100
commit31e718a6acd03f0cc3db5bc56e465bee933c1edb (patch)
tree91390f9c59b35be9e8c85c3039a954f4da42c036
parent27670729a5ef341a75d90e34b6979e6b0671e0f3 (diff)
stm32/mpbthciport: Allow building with MICROPY_PY_MACHINE_UART disabled.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/stm32/mpbthciport.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/stm32/mpbthciport.c b/ports/stm32/mpbthciport.c
index e764c6984..06ff8a7fa 100644
--- a/ports/stm32/mpbthciport.c
+++ b/ports/stm32/mpbthciport.c
@@ -170,7 +170,12 @@ int mp_bluetooth_hci_uart_init(uint32_t port, uint32_t baudrate) {
DEBUG_printf("mp_bluetooth_hci_uart_init (stm32)\n");
// bits (8), stop (1), parity (none) and flow (rts/cts) are assumed to match MYNEWT_VAL_BLE_HCI_UART_ constants in syscfg.h.
+ #if MICROPY_PY_MACHINE_UART
mp_bluetooth_hci_uart_obj.base.type = &machine_uart_type;
+ #else
+ // With machine.UART disabled this object is not user-accessible so doesn't need a type.
+ mp_bluetooth_hci_uart_obj.base.type = NULL;
+ #endif
mp_bluetooth_hci_uart_obj.uart_id = port;
mp_bluetooth_hci_uart_obj.is_static = true;
// We don't want to block indefinitely, but expect flow control is doing its job.