mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 08:37:22 +00:00
reset baud rate after downloading broadcom init script
This commit is contained in:
parent
d19678c809
commit
92a0d36dfa
16
src/hci.c
16
src/hci.c
@ -940,7 +940,21 @@ static void hci_initializing_run(void){
|
||||
hci_stack->hci_transport->send_packet(HCI_COMMAND_DATA_PACKET, hci_stack->hci_packet_buffer, size);
|
||||
break;
|
||||
}
|
||||
log_info("hci_run: init script done");
|
||||
log_info("hci_run: init script done");
|
||||
|
||||
// Init script download causes baud rate to reset on Broadcom chipsets, restore UART baud rate if needed
|
||||
if (hci_stack->manufacturer == 0x000f){
|
||||
int need_baud_change = hci_stack->config
|
||||
&& hci_stack->control
|
||||
&& hci_stack->control->baudrate_cmd
|
||||
&& hci_stack->hci_transport->set_baudrate
|
||||
&& ((hci_uart_config_t *)hci_stack->config)->baudrate_main;
|
||||
if (need_baud_change) {
|
||||
uint32_t baud_rate = ((hci_uart_config_t *)hci_stack->config)->baudrate_init;
|
||||
log_info("Local baud rate change to %"PRIu32" after init script", baud_rate);
|
||||
hci_stack->hci_transport->set_baudrate(baud_rate);
|
||||
}
|
||||
}
|
||||
}
|
||||
// otherwise continue
|
||||
hci_stack->substate = HCI_INIT_W4_READ_LOCAL_SUPPORTED_COMMANDS;
|
||||
|
Loading…
x
Reference in New Issue
Block a user