void BTU_ShutDown(void) { #if BTU_DYNAMIC_MEMORY FREE_AND_RESET(btu_cb_ptr); #endif btu_task_shut_down(); hash_map_free(btu_general_alarm_hash_map); osi_mutex_free(&btu_general_alarm_lock); hash_map_free(btu_oneshot_alarm_hash_map); osi_mutex_free(&btu_oneshot_alarm_lock); hash_map_free(btu_l2cap_alarm_hash_map); osi_mutex_free(&btu_l2cap_alarm_lock); vTaskDelete(xBtuTaskHandle); vQueueDelete(xBtuQueue); btu_general_alarm_hash_map = NULL; btu_oneshot_alarm_hash_map = NULL; btu_l2cap_alarm_hash_map = NULL; xBtuTaskHandle = NULL; xBtuQueue = 0; }
void BTU_ShutDown(void) { btu_task_shut_down(); fixed_queue_free(btu_bta_msg_queue, NULL); hash_map_free(btu_general_alarm_hash_map); pthread_mutex_destroy(&btu_general_alarm_lock); fixed_queue_free(btu_general_alarm_queue, NULL); hash_map_free(btu_oneshot_alarm_hash_map); pthread_mutex_destroy(&btu_oneshot_alarm_lock); fixed_queue_free(btu_oneshot_alarm_queue, NULL); hash_map_free(btu_l2cap_alarm_hash_map); pthread_mutex_destroy(&btu_l2cap_alarm_lock); fixed_queue_free(btu_l2cap_alarm_queue, NULL); //thread_free(bt_workqueue_thread); vTaskDelete(xBtuTaskHandle); vQueueDelete(xBtuQueue); btu_bta_msg_queue = NULL; btu_general_alarm_hash_map = NULL; btu_general_alarm_queue = NULL; btu_oneshot_alarm_hash_map = NULL; btu_oneshot_alarm_queue = NULL; btu_l2cap_alarm_hash_map = NULL; btu_l2cap_alarm_queue = NULL; // bt_workqueue_thread = NULL; xBtuTaskHandle = NULL; xBtuQueue = 0; }