From 5a14e8addf8f1266cc85c4e23734ae499b932a14 Mon Sep 17 00:00:00 2001 From: Tian Hao Date: Tue, 29 Nov 2016 17:42:04 +0800 Subject: [PATCH] component/bt : use ESP_LOGx instead of printf --- components/bt/Kconfig | 12 ------------ components/bt/bluedroid/bta/sdp/bta_sdp_api.c | 8 ++++---- components/bt/bluedroid/include/bt_trace.h | 10 ++++------ 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/components/bt/Kconfig b/components/bt/Kconfig index 669a001c5..cd450ff88 100644 --- a/components/bt/Kconfig +++ b/components/bt/Kconfig @@ -8,18 +8,6 @@ config BT_ENABLED help This compiles in the low-level BT stack. -menu "BT UTILITY OPTION" -visible if BT_ENABLED - -config BT_USE_ETS_PRINT - bool "BT use print which has nolock" - default y - depends on BT_ENABLED - help - This select use print or ets_print - -endmenu #menu - config BTC_TASK_STACK_SIZE int "BT event (callback to application) task stack size" default 2048 diff --git a/components/bt/bluedroid/bta/sdp/bta_sdp_api.c b/components/bt/bluedroid/bta/sdp/bta_sdp_api.c index e69451197..3969b45d8 100644 --- a/components/bt/bluedroid/bta/sdp/bta_sdp_api.c +++ b/components/bt/bluedroid/bta/sdp/bta_sdp_api.c @@ -59,7 +59,7 @@ tBTA_SDP_STATUS BTA_SdpEnable(tBTA_SDP_DM_CBACK *p_cback) tBTA_SDP_STATUS status = BTA_SDP_FAILURE; tBTA_SDP_API_ENABLE *p_buf; - APPL_TRACE_API(__FUNCTION__); + APPL_TRACE_API("%s\n", __FUNCTION__); if (p_cback && FALSE == bta_sys_is_register(BTA_ID_SDP)) { memset(&bta_sdp_cb, 0, sizeof(tBTA_SDP_CB)); @@ -95,7 +95,7 @@ tBTA_SDP_STATUS BTA_SdpSearch(BD_ADDR bd_addr, tSDP_UUID *uuid) tBTA_SDP_STATUS ret = BTA_SDP_FAILURE; tBTA_SDP_API_SEARCH *p_msg; - APPL_TRACE_API(__FUNCTION__); + APPL_TRACE_API("%s\n", __FUNCTION__); if ((p_msg = (tBTA_SDP_API_SEARCH *)GKI_getbuf(sizeof(tBTA_SDP_API_SEARCH))) != NULL) { p_msg->hdr.event = BTA_SDP_API_SEARCH_EVT; bdcpy(p_msg->bd_addr, bd_addr); @@ -125,7 +125,7 @@ tBTA_SDP_STATUS BTA_SdpCreateRecordByUser(void *user_data) tBTA_SDP_STATUS ret = BTA_SDP_FAILURE; tBTA_SDP_API_RECORD_USER *p_msg; - APPL_TRACE_API(__FUNCTION__); + APPL_TRACE_API("%s\n", __FUNCTION__); if ((p_msg = (tBTA_SDP_API_RECORD_USER *)GKI_getbuf(sizeof(tBTA_SDP_API_RECORD_USER))) != NULL) { p_msg->hdr.event = BTA_SDP_API_CREATE_RECORD_USER_EVT; p_msg->user_data = user_data; @@ -153,7 +153,7 @@ tBTA_SDP_STATUS BTA_SdpRemoveRecordByUser(void *user_data) tBTA_SDP_STATUS ret = BTA_SDP_FAILURE; tBTA_SDP_API_RECORD_USER *p_msg; - APPL_TRACE_API(__FUNCTION__); + APPL_TRACE_API("%s\n", __FUNCTION__); if ((p_msg = (tBTA_SDP_API_RECORD_USER *)GKI_getbuf(sizeof(tBTA_SDP_API_RECORD_USER))) != NULL) { p_msg->hdr.event = BTA_SDP_API_REMOVE_RECORD_USER_EVT; p_msg->user_data = user_data; diff --git a/components/bt/bluedroid/include/bt_trace.h b/components/bt/bluedroid/include/bt_trace.h index 14f258a60..d50e2e77d 100644 --- a/components/bt/bluedroid/include/bt_trace.h +++ b/components/bt/bluedroid/include/bt_trace.h @@ -22,13 +22,11 @@ #include #include "bt_types.h" -#include "rom/ets_sys.h" +#include "esp_log.h" -#ifdef CONFIG_BT_USE_ETS_PRINT -#define BT_PRINTF ets_printf -#else -#define BT_PRINTF printf -#endif +#define TAG "BT" + +#define BT_PRINTF(fmt, ...) ESP_LOGE(TAG, fmt, ##__VA_ARGS__) #ifndef assert #define assert(x) do { if (!(x)) BT_PRINTF("bt host error %s %u\n", __FILE__, __LINE__); } while (0)