From a45dac0bd1699c2557cbbc8d65e811306390588f Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 25 Jul 2017 09:22:26 -0500 Subject: [PATCH] dts: fix Kconfig enablment of BLUETOOTH_MONITOR_ON_DEV_NAME Since we generate BLUETOOTH_MONITOR_ON_DEV_NAME based on dts we need a !HAS_DTS check around it. Otherwise we can get into odd build errors. Its also possibly that we don't specify "zephyr,bt-mon-uart" and in that case we default to CONFIG_UART_CONSOLE_ON_DEV_NAME (ie 'zephyr,console' on DTS platforms). Signed-off-by: Kumar Gala --- subsys/bluetooth/common/Kconfig | 2 ++ subsys/bluetooth/host/monitor.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index 85518c09717..4d8476871f7 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -66,6 +66,7 @@ config BLUETOOTH_DEBUG_COLOR help Use color in the logs. This requires an ANSI capable terminal. +if !HAS_DTS config BLUETOOTH_MONITOR_ON_DEV_NAME string "Device Name of Bluetooth monitor logging UART" depends on BLUETOOTH_DEBUG_MONITOR @@ -73,6 +74,7 @@ config BLUETOOTH_MONITOR_ON_DEV_NAME help This option specifies the name of UART device to be used for the Bluetooth monitor logging. +endif config BLUETOOTH_DEBUG_HCI_DRIVER bool "Bluetooth HCI driver debug" diff --git a/subsys/bluetooth/host/monitor.c b/subsys/bluetooth/host/monitor.c index 46f3284f3a8..63b2173b429 100644 --- a/subsys/bluetooth/host/monitor.c +++ b/subsys/bluetooth/host/monitor.c @@ -237,6 +237,10 @@ extern void __printk_hook_install(int (*fn)(int)); extern void __stdout_hook_install(int (*fn)(int)); #endif /* !CONFIG_UART_CONSOLE */ +#if defined(CONFIG_HAS_DTS) && !defined(CONFIG_BLUETOOTH_MONITOR_ON_DEV_NAME) +#define CONFIG_BLUETOOTH_MONITOR_ON_DEV_NAME CONFIG_UART_CONSOLE_ON_DEV_NAME +#endif + static int bt_monitor_init(struct device *d) { ARG_UNUSED(d);