1
0
mirror of https://github.com/bluekitchen/btstack.git synced 2025-04-18 05:42:49 +00:00

hci: reset H5/BCSP link for CSR with baud change

This commit is contained in:
Matthias Ringwald 2017-04-07 11:52:33 +02:00
parent 1b84b25d6a
commit 834bce8cfd

@ -993,8 +993,12 @@ static void hci_initialization_timeout_handler(btstack_timer_source_t * ds){
log_info("Local baud rate change to %"PRIu32"(timeout handler)", baud_rate); log_info("Local baud rate change to %"PRIu32"(timeout handler)", baud_rate);
hci_stack->hci_transport->set_baudrate(baud_rate); hci_stack->hci_transport->set_baudrate(baud_rate);
} }
// For CSR, HCI Reset is sent on new baud rate // For CSR, HCI Reset is sent on new baud rate. Don't forget to reset link for H5/BCSP
if (hci_stack->manufacturer == BLUETOOTH_COMPANY_ID_CAMBRIDGE_SILICON_RADIO){ if (hci_stack->manufacturer == BLUETOOTH_COMPANY_ID_CAMBRIDGE_SILICON_RADIO){
if (hci_stack->hci_transport->reset_link){
log_info("Link Reset");
hci_stack->hci_transport->reset_link();
}
hci_stack->substate = HCI_INIT_SEND_RESET_CSR_WARM_BOOT; hci_stack->substate = HCI_INIT_SEND_RESET_CSR_WARM_BOOT;
hci_run(); hci_run();
} }