mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-25 16:43:28 +00:00
hci: reserve packet buffer for custom init
This commit is contained in:
parent
ca6804fd63
commit
ee418d0f5b
@ -1972,6 +1972,7 @@ static void hci_initializing_run(void){
|
|||||||
case HCI_INIT_CUSTOM_PRE_INIT:
|
case HCI_INIT_CUSTOM_PRE_INIT:
|
||||||
// Custom initialization
|
// Custom initialization
|
||||||
if (hci_stack->chipset && hci_stack->chipset->next_command){
|
if (hci_stack->chipset && hci_stack->chipset->next_command){
|
||||||
|
hci_reserve_packet_buffer();
|
||||||
hci_stack->chipset_result = (*hci_stack->chipset->next_command)(hci_stack->hci_packet_buffer);
|
hci_stack->chipset_result = (*hci_stack->chipset->next_command)(hci_stack->hci_packet_buffer);
|
||||||
bool send_cmd = false;
|
bool send_cmd = false;
|
||||||
switch (hci_stack->chipset_result){
|
switch (hci_stack->chipset_result){
|
||||||
@ -2012,10 +2013,11 @@ static void hci_initializing_run(void){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (send_cmd){
|
if (send_cmd){
|
||||||
hci_reserve_packet_buffer();
|
|
||||||
hci_stack->last_cmd_opcode = little_endian_read_16(hci_stack->hci_packet_buffer, 0);
|
hci_stack->last_cmd_opcode = little_endian_read_16(hci_stack->hci_packet_buffer, 0);
|
||||||
hci_send_prepared_cmd_packet();
|
hci_send_prepared_cmd_packet();
|
||||||
break;
|
break;
|
||||||
|
} else {
|
||||||
|
hci_release_packet_buffer();
|
||||||
}
|
}
|
||||||
log_info("Init script done");
|
log_info("Init script done");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user