mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-31 10:20:58 +00:00
less hacks during boot-up
This commit is contained in:
parent
94a521cb7e
commit
fe97d0a421
@ -965,17 +965,14 @@ static void event_handler(uint8_t *packet, int size){
|
|||||||
if (hci_stack->state == HCI_STATE_INITIALIZING){
|
if (hci_stack->state == HCI_STATE_INITIALIZING){
|
||||||
if (hci_stack->substate % 2){
|
if (hci_stack->substate % 2){
|
||||||
// odd: waiting for event
|
// odd: waiting for event
|
||||||
if (packet[0] == HCI_EVENT_COMMAND_COMPLETE || packet[0] == HCI_EVENT_COMMAND_STATUS){
|
if (packet[0] == HCI_EVENT_COMMAND_COMPLETE){
|
||||||
// wait for explicit COMMAND COMPLETE on RESET
|
hci_stack->substate++;
|
||||||
if (hci_stack->substate > 1 || COMMAND_COMPLETE_EVENT(packet, hci_reset)) {
|
|
||||||
hci_stack->substate++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK to deal with duplicate HCI Reset Complete events seen on cheapo CSR8510 A10 USB Dongle
|
// HACK to deal with duplicate HCI Reset Complete events seen on cheapo CSR8510 A10 USB Dongle
|
||||||
if (COMMAND_COMPLETE_EVENT(packet, hci_reset)){
|
if (COMMAND_COMPLETE_EVENT(packet, hci_reset)){
|
||||||
if (hci_stack->state == HCI_STATE_INITIALIZING) {
|
if (hci_stack->state == HCI_STATE_INITIALIZING) {
|
||||||
if (hci_stack->config == 0 || ((hci_uart_config_t *)hci_stack->config)->baudrate_main == 0){
|
if (hci_stack->config == NULL || ((hci_uart_config_t *)hci_stack->config)->baudrate_main == 0){
|
||||||
hci_stack->substate = 6; // >> 1 = 3
|
hci_stack->substate = 6; // >> 1 = 3
|
||||||
} else {
|
} else {
|
||||||
hci_stack->substate = 2; // >> 1 = 1
|
hci_stack->substate = 2; // >> 1 = 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user