bcm: skip reset baud rate after init script if init script is empty, e.g. CYW20707

This commit is contained in:
Matthias Ringwald 2019-05-14 14:15:23 +02:00
parent ee720f3a8f
commit 1565be948b
3 changed files with 8 additions and 3 deletions

View File

@ -120,7 +120,7 @@ static btstack_chipset_result_t chipset_next_command(uint8_t * hci_cmd_buffer){
hcd_fd = open(hcd_file_path, O_RDONLY);
if (hcd_fd < 0){
log_error("chipset-bcm: can't open file %s", hcd_file_path);
return BTSTACK_CHIPSET_DONE;
return BTSTACK_CHIPSET_NO_INIT_SCRIPT;
}
}
@ -263,6 +263,9 @@ static void chipset_init(const void * config){
}
static btstack_chipset_result_t chipset_next_command(uint8_t * hci_cmd_buffer){
// no initscript
if (brcm_patch_ram_length == 0) return BTSTACK_CHIPSET_NO_INIT_SCRIPT;
// send download firmware command
if (send_download_command){
send_download_command = 0;

View File

@ -56,6 +56,7 @@ typedef enum {
BTSTACK_CHIPSET_DONE = 0,
BTSTACK_CHIPSET_VALID_COMMAND,
BTSTACK_CHIPSET_WARMSTART_REQUIRED,
BTSTACK_CHIPSET_NO_INIT_SCRIPT,
} btstack_chipset_result_t;

View File

@ -1310,8 +1310,9 @@ static void hci_initializing_run(void){
log_info("Init script done");
// Init script download on Broadcom chipsets causes:
if (hci_stack->manufacturer == BLUETOOTH_COMPANY_ID_BROADCOM_CORPORATION
|| hci_stack->manufacturer == BLUETOOTH_COMPANY_ID_EM_MICROELECTRONIC_MARIN_SA){
if ( (result != BTSTACK_CHIPSET_NO_INIT_SCRIPT) &&
( hci_stack->manufacturer == BLUETOOTH_COMPANY_ID_BROADCOM_CORPORATION
|| hci_stack->manufacturer == BLUETOOTH_COMPANY_ID_EM_MICROELECTRONIC_MARIN_SA) ){
// - baud rate to reset, restore UART baud rate if needed
int need_baud_change = hci_stack->config