mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-20 18:40:31 +00:00
h5 ports: use btstack_uart_posix without slip wrapper
This commit is contained in:
parent
95b3bfd1d3
commit
79530e3778
@ -7,8 +7,7 @@ CORE += \
|
||||
btstack_link_key_db_tlv.c \
|
||||
btstack_run_loop_posix.c \
|
||||
btstack_tlv_posix.c \
|
||||
btstack_uart_block_posix.c \
|
||||
btstack_uart_slip_wrapper.c \
|
||||
btstack_uart_posix.c \
|
||||
btstack_slip.c \
|
||||
hci_transport_h5.c \
|
||||
le_device_db_tlv.c \
|
||||
|
@ -62,8 +62,6 @@
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#include "btstack_stdin.h"
|
||||
#include "btstack_uart.h"
|
||||
#include "btstack_uart_block.h"
|
||||
#include "btstack_uart_slip_wrapper.h"
|
||||
#include "btstack_tlv_posix.h"
|
||||
#include "classic/btstack_link_key_db_tlv.h"
|
||||
#include "hci.h"
|
||||
@ -165,19 +163,18 @@ int main(int argc, const char * argv[]){
|
||||
btstack_chipset_bcm_set_device_name("BCM43430A1");
|
||||
|
||||
// setup UART driver
|
||||
const btstack_uart_t * uart_block_driver = (const btstack_uart_t *) btstack_uart_block_posix_instance();
|
||||
const btstack_uart_t * uart_slip_driver = btstack_uart_slip_wrapper_instance(uart_block_driver);
|
||||
const btstack_uart_t * uart_driver = (const btstack_uart_t *) btstack_uart_posix_instance();
|
||||
|
||||
// extract UART config from transport config
|
||||
uart_config.baudrate = transport_config.baudrate_init;
|
||||
uart_config.flowcontrol = transport_config.flowcontrol;
|
||||
uart_config.device_name = transport_config.device_name;
|
||||
uart_block_driver->init(&uart_config);
|
||||
uart_driver->init(&uart_config);
|
||||
|
||||
|
||||
// setup HCI (to be able to use bcm chipset driver)
|
||||
// init HCI
|
||||
const hci_transport_t * transport = hci_transport_h5_instance(uart_slip_driver);
|
||||
const hci_transport_t * transport = hci_transport_h5_instance(uart_driver);
|
||||
hci_init(transport, (void*) &transport_config);
|
||||
hci_set_chipset(btstack_chipset_bcm_instance());
|
||||
|
||||
@ -195,7 +192,7 @@ int main(int argc, const char * argv[]){
|
||||
printf("Phase 1: Download firmware\n");
|
||||
|
||||
// phase #2 start main app
|
||||
btstack_chipset_bcm_download_firmware(uart_block_driver, transport_config.baudrate_main, &phase2);
|
||||
btstack_chipset_bcm_download_firmware_with_uart(uart_driver, transport_config.baudrate_main, &phase2);
|
||||
|
||||
// go
|
||||
btstack_run_loop_execute();
|
||||
|
@ -11,8 +11,7 @@ CORE += \
|
||||
btstack_link_key_db_tlv.c \
|
||||
btstack_run_loop_posix.c \
|
||||
btstack_tlv_posix.c \
|
||||
btstack_uart_block_posix.c \
|
||||
btstack_uart_slip_wrapper.c \
|
||||
btstack_uart_posix.c \
|
||||
btstack_slip.c \
|
||||
hci_transport_h5.c \
|
||||
le_device_db_tlv.c \
|
||||
|
@ -64,8 +64,6 @@
|
||||
#include "btstack_stdin.h"
|
||||
#include "btstack_tlv_posix.h"
|
||||
#include "btstack_uart.h"
|
||||
#include "btstack_uart_block.h"
|
||||
#include "btstack_uart_slip_wrapper.h"
|
||||
|
||||
#include "btstack_chipset_csr.h"
|
||||
#include "btstack_chipset_cc256x.h"
|
||||
@ -223,9 +221,8 @@ int main(int argc, const char * argv[]){
|
||||
printf("H5 device: %s\n", config.device_name);
|
||||
|
||||
// init HCI
|
||||
const btstack_uart_t * uart_block_driver = (const btstack_uart_t *) btstack_uart_block_posix_instance();
|
||||
const btstack_uart_t * uart_slip_driver = btstack_uart_slip_wrapper_instance(uart_block_driver);
|
||||
const hci_transport_t * transport = hci_transport_h5_instance(uart_slip_driver);
|
||||
const btstack_uart_t * uart_driver = (const btstack_uart_t *) btstack_uart_posix_instance();
|
||||
const hci_transport_t * transport = hci_transport_h5_instance(uart_driver);
|
||||
hci_init(transport, (void*) &config);
|
||||
|
||||
// enable BCSP mode for CSR chipsets - auto detect might not work
|
||||
|
@ -8,8 +8,7 @@ CORE += \
|
||||
btstack_link_key_db_tlv.c \
|
||||
btstack_run_loop_posix.c \
|
||||
btstack_tlv_posix.c \
|
||||
btstack_uart_block_posix.c \
|
||||
btstack_uart_slip_wrapper.c \
|
||||
btstack_uart_posix.c \
|
||||
btstack_slip.c \
|
||||
hci_transport_h4.c \
|
||||
hci_transport_h5.c \
|
||||
|
@ -371,21 +371,20 @@ int main(int argc, const char * argv[]){
|
||||
btstack_chipset_bcm_set_hcd_folder_path("/lib/firmware/brcm");
|
||||
|
||||
// setup UART driver
|
||||
const btstack_uart_block_t * uart_block_driver = btstack_uart_block_posix_instance();
|
||||
const btstack_uart_t * uart_driver = btstack_uart_posix_instance();
|
||||
|
||||
// extract UART config from transport config
|
||||
uart_config.baudrate = transport_config.baudrate_init;
|
||||
uart_config.flowcontrol = transport_config.flowcontrol;
|
||||
uart_config.device_name = transport_config.device_name;
|
||||
uart_block_driver->init(&uart_config);
|
||||
uart_driver->init(&uart_config);
|
||||
|
||||
// HW with FlowControl -> we can use regular h4 mode
|
||||
const hci_transport_t * transport;
|
||||
if (transport_config.flowcontrol){
|
||||
transport = hci_transport_h4_instance(uart_block_driver);
|
||||
transport = hci_transport_h4_instance(uart_driver);
|
||||
} else {
|
||||
const btstack_uart_t * uart_slip_driver = btstack_uart_slip_wrapper_instance(uart_block_driver);
|
||||
transport = hci_transport_h5_instance(uart_slip_driver);
|
||||
transport = hci_transport_h5_instance(uart_driver);
|
||||
}
|
||||
|
||||
// setup HCI (to be able to use bcm chipset driver)
|
||||
@ -432,7 +431,7 @@ int main(int argc, const char * argv[]){
|
||||
printf("Phase 1: Download firmware\n");
|
||||
|
||||
// phase #2 start main app
|
||||
btstack_chipset_bcm_download_firmware(uart_block_driver, transport_config.baudrate_main, &phase2);
|
||||
btstack_chipset_bcm_download_firmware(uart_driver, transport_config.baudrate_main, &phase2);
|
||||
}
|
||||
|
||||
// go
|
||||
|
Loading…
x
Reference in New Issue
Block a user