From b436fa16b588af27b6e17cdcba3871ffa618efbe Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Thu, 11 Feb 2016 15:32:14 +0200 Subject: [PATCH] drivers/nble: Enable UART debug only if BLUETOOTH_DEBUG_DRIVER enabled This allows to decrease number debug messages using config option. Change-Id: I987d25c6d4b18503d6beb7feab97e9207100323d Signed-off-by: Andrei Emeltchenko --- drivers/nble/uart.c | 5 +++++ samples/bluetooth/beacon/prj_nble.conf | 1 + samples/bluetooth/peripheral/prj_nble.conf | 1 + samples/bluetooth/peripheral_hr/prj_nble.conf | 1 + samples/bluetooth/shell/prj_nble.conf | 1 + 5 files changed, 9 insertions(+) diff --git a/drivers/nble/uart.c b/drivers/nble/uart.c index 9f9b7c83d5a..2ad95c19423 100644 --- a/drivers/nble/uart.c +++ b/drivers/nble/uart.c @@ -31,6 +31,11 @@ #include "uart.h" #include "rpc.h" +#if !defined(CONFIG_BLUETOOTH_DEBUG_DRIVER) +#undef BT_DBG +#define BT_DBG(fmt, ...) +#endif + /** * @note this structure must be self-aligned and self-packed */ diff --git a/samples/bluetooth/beacon/prj_nble.conf b/samples/bluetooth/beacon/prj_nble.conf index ba9f2e8b119..4e25bdbdd0c 100644 --- a/samples/bluetooth/beacon/prj_nble.conf +++ b/samples/bluetooth/beacon/prj_nble.conf @@ -1,3 +1,4 @@ CONFIG_NBLE=y CONFIG_ARC_INIT=n CONFIG_BLUETOOTH_DEBUG=y +CONFIG_BLUETOOTH_DEBUG_DRIVER=y diff --git a/samples/bluetooth/peripheral/prj_nble.conf b/samples/bluetooth/peripheral/prj_nble.conf index ba9f2e8b119..4e25bdbdd0c 100644 --- a/samples/bluetooth/peripheral/prj_nble.conf +++ b/samples/bluetooth/peripheral/prj_nble.conf @@ -1,3 +1,4 @@ CONFIG_NBLE=y CONFIG_ARC_INIT=n CONFIG_BLUETOOTH_DEBUG=y +CONFIG_BLUETOOTH_DEBUG_DRIVER=y diff --git a/samples/bluetooth/peripheral_hr/prj_nble.conf b/samples/bluetooth/peripheral_hr/prj_nble.conf index ba9f2e8b119..4e25bdbdd0c 100644 --- a/samples/bluetooth/peripheral_hr/prj_nble.conf +++ b/samples/bluetooth/peripheral_hr/prj_nble.conf @@ -1,3 +1,4 @@ CONFIG_NBLE=y CONFIG_ARC_INIT=n CONFIG_BLUETOOTH_DEBUG=y +CONFIG_BLUETOOTH_DEBUG_DRIVER=y diff --git a/samples/bluetooth/shell/prj_nble.conf b/samples/bluetooth/shell/prj_nble.conf index b3e4095d355..2e92a979153 100644 --- a/samples/bluetooth/shell/prj_nble.conf +++ b/samples/bluetooth/shell/prj_nble.conf @@ -5,3 +5,4 @@ CONFIG_ARC_INIT=n CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER_SHELL=y CONFIG_BLUETOOTH_DEBUG=y +CONFIG_BLUETOOTH_DEBUG_DRIVER=y