From cca1ca7af7b8f5ef7a83d92ac031e81477544edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 14 Jun 2018 09:53:00 +0200 Subject: [PATCH] kconfig: Change how BT affects SYSTEM_WORKQUEUE_PRIORITY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Invalid configurations should be detected during configuration instead of during compilation whenever possible. This patch replaces a BUILD_ASSERT on CONFIG_SYSTEM_WORKQUEUE_PRIORITY with what is intended to be an equivalent Kconfig restriction. Signed-off-by: Sebastian Bøe --- subsys/bluetooth/Kconfig | 5 +++++ subsys/bluetooth/common/dummy.c | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/Kconfig b/subsys/bluetooth/Kconfig index 9e82343ec5cd9..227d8daa4cfa3 100644 --- a/subsys/bluetooth/Kconfig +++ b/subsys/bluetooth/Kconfig @@ -35,6 +35,11 @@ config BT_CUSTOM endchoice +# The Bluetooth subsystem requires the system workqueue to execute at +# a cooperative priority. +config SYSTEM_WORKQUEUE_PRIORITY + range -256 -1 + if BT_HCI config BT_HCI_RAW diff --git a/subsys/bluetooth/common/dummy.c b/subsys/bluetooth/common/dummy.c index a0d6c8155095b..b9851079e3165 100644 --- a/subsys/bluetooth/common/dummy.c +++ b/subsys/bluetooth/common/dummy.c @@ -11,13 +11,6 @@ #include -/* The Bluetooth subsystem requires the system workqueue to execute at a - * cooperative priority to function correctly. If this build assert triggers - * verify your configuration to ensure that cooperative threads are enabled - * and that the system workqueue priority is negative (cooperative). - */ -BUILD_ASSERT(CONFIG_SYSTEM_WORKQUEUE_PRIORITY < 0); - /* The Bluetooth subsystem requires the Tx thread to execute at higher priority * than the Rx thread as the Tx thread needs to process the acknowledgements * before new Rx data is processed. This is a necessity to correctly detect