From d5f02c83024bade9dfd364985d7fec5fa2e4a6c4 Mon Sep 17 00:00:00 2001 From: baohongde Date: Thu, 23 Apr 2020 17:58:52 +0800 Subject: [PATCH] add DRAM_ATTR & add logs --- components/bt/bluedroid/stack/btu/btu_hcif.c | 2 +- components/bt/bt.c | 6 ++++-- components/bt/hli_api.c | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/bt/bluedroid/stack/btu/btu_hcif.c b/components/bt/bluedroid/stack/btu/btu_hcif.c index 7f0395a5b3..0b44a9cadc 100644 --- a/components/bt/bluedroid/stack/btu/btu_hcif.c +++ b/components/bt/bluedroid/stack/btu/btu_hcif.c @@ -620,7 +620,7 @@ static void btu_hcif_disconnection_comp_evt (UINT8 *p) STREAM_TO_UINT8 (reason, p); handle = HCID_GET_HANDLE (handle); - + ets_printf("\n##C##: %s: 0x%x, 0x%x\n", __func__, handle, reason); #if BTM_SCO_INCLUDED == TRUE /* If L2CAP doesn't know about it, send it to SCO */ if (!l2c_link_hci_disc_comp (handle, reason)) { diff --git a/components/bt/bt.c b/components/bt/bt.c index 52438bb1b1..9eb79a71aa 100644 --- a/components/bt/bt.c +++ b/components/bt/bt.c @@ -381,7 +381,7 @@ struct interrupt_hlevel_cb{ uint8_t nested; }; -struct interrupt_hlevel_cb hli_cb = { +static DRAM_ATTR struct interrupt_hlevel_cb hli_cb = { .status = 0, .nested = 0, }; @@ -499,7 +499,7 @@ static void *queue_create_hlevel_wrapper(uint32_t queue_len, uint32_t item_size, { QueueHandle_t downstream_queue = xQueueCreate(queue_len, item_size); assert(downstream_queue); - hli_queue_handle_t queue; + hli_queue_handle_t queue = NULL; /** * TODO: Should use macro here! */ @@ -947,6 +947,8 @@ esp_err_t esp_bt_mem_release(esp_bt_mode_t mode) esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) { + + ets_printf("\n##C##: BT version: hli_0423\n"); esp_err_t err; uint32_t btdm_cfg_mask = 0; diff --git a/components/bt/hli_api.c b/components/bt/hli_api.c index ba1d0f3f57..7fb70434d1 100644 --- a/components/bt/hli_api.c +++ b/components/bt/hli_api.c @@ -46,7 +46,7 @@ static void IRAM_ATTR customer_swisr_handle(customer_swisr_t *cus_swisr) } } -static hli_handler_info_t s_hli_handlers[HLI_MAX_HANDLERS]; +static DRAM_ATTR hli_handler_info_t s_hli_handlers[HLI_MAX_HANDLERS]; // static const char* TAG = "hli_queue"; esp_err_t hli_intr_register(intr_handler_t handler, void* arg, uint32_t intr_reg, uint32_t intr_mask) @@ -114,7 +114,7 @@ void IRAM_ATTR hli_intr_restore(uint32_t state) #define HLI_QUEUE_FLAG_SEMAPHORE BIT(0) #define HLI_QUEUE_FLAG_CUSTOMER BIT(1) -struct hli_queue_t *s_meta_queue_ptr = NULL; +static DRAM_ATTR struct hli_queue_t *s_meta_queue_ptr = NULL; intr_handle_t ret_handle; static inline char* IRAM_ATTR wrap_ptr(hli_queue_handle_t queue, char *ptr) @@ -139,7 +139,7 @@ static void IRAM_ATTR queue_isr_handler(void* arg) hli_queue_handle_t queue; while (hli_queue_get(s_meta_queue_ptr, &queue)) { - static char scratch[HLI_QUEUE_MAX_ELEM_SIZE]; + static DRAM_ATTR char scratch[HLI_QUEUE_MAX_ELEM_SIZE]; while (hli_queue_get(queue, scratch)) { int res = pdPASS; if ((queue->flags & HLI_QUEUE_FLAG_CUSTOMER) != 0) {