mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
csr: change local baudrate before sending warm reset command
This commit is contained in:
parent
7b90e0b281
commit
772a36d34e
16
src/hci.c
16
src/hci.c
@ -848,6 +848,11 @@ static void hci_initialization_timeout_handler(timer_source_t * ds){
|
|||||||
case HCI_INIT_W4_SEND_BAUD_CHANGE:
|
case HCI_INIT_W4_SEND_BAUD_CHANGE:
|
||||||
log_info("Local baud rate change to %"PRIu32, ((hci_uart_config_t *)hci_stack->config)->baudrate_main);
|
log_info("Local baud rate change to %"PRIu32, ((hci_uart_config_t *)hci_stack->config)->baudrate_main);
|
||||||
hci_stack->hci_transport->set_baudrate(((hci_uart_config_t *)hci_stack->config)->baudrate_main);
|
hci_stack->hci_transport->set_baudrate(((hci_uart_config_t *)hci_stack->config)->baudrate_main);
|
||||||
|
// For CSR, HCI Reset is sent on new baud rate
|
||||||
|
if (hci_stack->manufacturer == 0x000a){
|
||||||
|
hci_stack->substate = HCI_INIT_SEND_RESET_CSR_WARM_BOOT;
|
||||||
|
hci_run();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -932,7 +937,16 @@ static void hci_initializing_run(void){
|
|||||||
run_loop_set_timer(&hci_stack->timeout, 100);
|
run_loop_set_timer(&hci_stack->timeout, 100);
|
||||||
run_loop_set_timer_handler(&hci_stack->timeout, hci_initialization_timeout_handler);
|
run_loop_set_timer_handler(&hci_stack->timeout, hci_initialization_timeout_handler);
|
||||||
run_loop_add_timer(&hci_stack->timeout);
|
run_loop_add_timer(&hci_stack->timeout);
|
||||||
hci_stack->substate = HCI_INIT_W4_CUSTOM_INIT_CSR_WARM_BOOT;
|
if (hci_stack->manufacturer == 0x000a
|
||||||
|
&& hci_stack->config
|
||||||
|
&& hci_stack->control
|
||||||
|
// && hci_stack->control->baudrate_cmd -- there's no such command
|
||||||
|
&& hci_stack->hci_transport->set_baudrate
|
||||||
|
&& ((hci_uart_config_t *)hci_stack->config)->baudrate_main){
|
||||||
|
hci_stack->substate = HCI_INIT_W4_SEND_BAUD_CHANGE;
|
||||||
|
} else {
|
||||||
|
hci_stack->substate = HCI_INIT_W4_CUSTOM_INIT_CSR_WARM_BOOT;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
hci_stack->hci_transport->send_packet(HCI_COMMAND_DATA_PACKET, hci_stack->hci_packet_buffer, size);
|
hci_stack->hci_transport->send_packet(HCI_COMMAND_DATA_PACKET, hci_stack->hci_packet_buffer, size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user