Merge branch 'bugfix/btdm_xQueueGenericSend_assertion' into 'master'

component/bt: Fix xQueueGenericSend assertion

See merge request idf/esp-idf!2130
This commit is contained in:
Jiang Jiang Jian 2018-03-30 14:02:24 +08:00
commit 713529e464
2 changed files with 23 additions and 17 deletions

View file

@ -160,9 +160,11 @@ int btc_init(void)
{ {
xBtcQueue = xQueueCreate(BTC_TASK_QUEUE_LEN, sizeof(btc_msg_t)); xBtcQueue = xQueueCreate(BTC_TASK_QUEUE_LEN, sizeof(btc_msg_t));
xTaskCreatePinnedToCore(btc_task, "Btc_task", BTC_TASK_STACK_SIZE, NULL, BTC_TASK_PRIO, &xBtcTaskHandle, BTC_TASK_PINNED_TO_CORE); xTaskCreatePinnedToCore(btc_task, "Btc_task", BTC_TASK_STACK_SIZE, NULL, BTC_TASK_PRIO, &xBtcTaskHandle, BTC_TASK_PINNED_TO_CORE);
if (xBtcTaskHandle == NULL || xBtcQueue == 0){
return BT_STATUS_NOMEM;
}
btc_gap_callback_init(); btc_gap_callback_init();
/* TODO: initial the profile_tab */ /* TODO: initial the profile_tab */
return BT_STATUS_SUCCESS; return BT_STATUS_SUCCESS;
} }

View file

@ -123,6 +123,10 @@ static struct alarm_t *alarm_cbs_lookfor_available(void)
static void alarm_cb_handler(struct alarm_t *alarm) static void alarm_cb_handler(struct alarm_t *alarm)
{ {
LOG_DEBUG("TimerID %p\n", alarm); LOG_DEBUG("TimerID %p\n", alarm);
if (alarm_state != ALARM_STATE_OPEN) {
LOG_WARN("%s, invalid state %d\n", __func__, alarm_state);
return;
}
btc_msg_t msg; btc_msg_t msg;
btc_alarm_args_t arg; btc_alarm_args_t arg;
msg.sig = BTC_SIG_API_CALL; msg.sig = BTC_SIG_API_CALL;
@ -181,7 +185,7 @@ static osi_alarm_err_t alarm_free(osi_alarm_t *alarm)
LOG_ERROR("%s null\n", __func__); LOG_ERROR("%s null\n", __func__);
return OSI_ALARM_ERR_INVALID_ARG; return OSI_ALARM_ERR_INVALID_ARG;
} }
esp_timer_stop(alarm->alarm_hdl);
esp_err_t stat = esp_timer_delete(alarm->alarm_hdl); esp_err_t stat = esp_timer_delete(alarm->alarm_hdl);
if (stat != ESP_OK) { if (stat != ESP_OK) {
LOG_ERROR("%s failed to delete timer, err 0x%x\n", __func__, stat); LOG_ERROR("%s failed to delete timer, err 0x%x\n", __func__, stat);