8000 stm32/mpbtstackport: Allow chipset and secondary baudrate to be set. · larsks/micropython@301fe80 · GitHub
  • [go: up one dir, main page]

    Skip to content

    Commit 301fe80

    Browse files
    committed
    stm32/mpbtstackport: Allow chipset and secondary baudrate to be set.
    Signed-off-by: Damien George <damien@micropython.org>
    1 parent 89cb2c6 commit 301fe80

    File tree

    2 files changed

    +5
    -4
    lines changed

    2 files changed

    +5
    -4
    lines changed

    ports/stm32/boards/PYBD_SF2/mpconfigboard.h

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -185,6 +185,7 @@ extern struct _spi_bdev_t spi_bdev2;
    185185
    // Bluetooth config
    186186
    #define MICROPY_HW_BLE_UART_ID (PYB_UART_6)
    187187
    #define MICROPY_HW_BLE_UART_BAUDRATE (115200)
    188+
    #define MICROPY_HW_BLE_UART_BAUDRATE_SECONDARY (3000000)
    188189

    189190
    /******************************************************************************/
    190191
    // Bootloader configuration

    ports/stm32/mpbtstackport.c

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -58,7 +58,7 @@ uint32_t hal_time_ms(void) {
    5858
    STATIC const hci_transport_config_uart_t hci_transport_config_uart = {
    5959
    HCI_TRANSPORT_CONFIG_UART,
    6060
    MICROPY_HW_BLE_UART_BAUDRATE,
    61-
    3000000,
    61+
    MICROPY_HW_BLE_UART_BAUDRATE_SECONDARY,
    6262
    0,
    6363
    NULL,
    6464
    };
    @@ -90,9 +90,9 @@ void mp_bluetooth_btstack_port_init(void) {
    9090
    const hci_transport_t *transport = hci_transport_h4_instance(&mp_bluetooth_btstack_hci_uart_block);
    9191
    hci_init(transport, &hci_transport_config_uart);
    9292

    93-
    // TODO: Probably not necessary for BCM (we have our own firmware loader in the cyw43 driver),
    94-
    // but might be worth investigating for other controllers in the future.
    95-
    // hci_set_chipset(btstack_chipset_bcm_instance());
    93+
    #ifdef MICROPY_HW_BLE_BTSTACK_CHIPSET_INSTANCE
    94+
    hci_set_chipset(MICROPY_HW_BLE_BTSTACK_CHIPSET_INSTANCE);
    95+
    #endif
    9696
    }
    9797

    9898
    void mp_bluetooth_btstack_port_deinit(void) {

    0 commit comments

    Comments
     (0)
    0