Skip to content

Commit 31e718a

Browse files
committed
stm32/mpbthciport: Allow building with MICROPY_PY_MACHINE_UART disabled.
Signed-off-by: Damien George <[email protected]>
1 parent 2767072 commit 31e718a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ports/stm32/mpbthciport.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ int mp_bluetooth_hci_uart_init(uint32_t port, uint32_t baudrate) {
170170
DEBUG_printf("mp_bluetooth_hci_uart_init (stm32)\n");
171171

172172
// bits (8), stop (1), parity (none) and flow (rts/cts) are assumed to match MYNEWT_VAL_BLE_HCI_UART_ constants in syscfg.h.
173+
#if MICROPY_PY_MACHINE_UART
173174
mp_bluetooth_hci_uart_obj.base.type = &machine_uart_type;
175+
#else
176+
// With machine.UART disabled this object is not user-accessible so doesn't need a type.
177+
mp_bluetooth_hci_uart_obj.base.type = NULL;
178+
#endif
174179
mp_bluetooth_hci_uart_obj.uart_id = port;
175180
mp_bluetooth_hci_uart_obj.is_static = true;
176181
// We don't want to block indefinitely, but expect flow control is doing its job.

0 commit comments

Comments
 (0)