From ff1d8efd3836df11bc8e07eacdc7137ab78762cb Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Wed, 30 Dec 2020 05:01:47 -0800 Subject: [PATCH] Bluetooth: controller: Fix error when max ant. pattern len not defined Fix compilation error if CONFIG_BT_CTLR_DF is not defined. If DF was not enabled, there was missing CONFIG_BT_CTLR_DF_MAX_- ANT_SW_PATTERN_LEN and undeclared symbol was found. Split ll_df.h into two parts: - ll_df.h that is generally includeable and allows to successfully compile sources when DF is not enabled. - ll_df_internal.h to be used in soucres that are compiled when DF is enabled. Signed-off-by: Piotr Pryga --- subsys/bluetooth/controller/ll_sw/lll_df.h | 21 -------------- .../controller/ll_sw/lll_df_internal.h | 29 +++++++++++++++++++ subsys/bluetooth/controller/ll_sw/ull_df.c | 2 +- 3 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 subsys/bluetooth/controller/ll_sw/lll_df_internal.h diff --git a/subsys/bluetooth/controller/ll_sw/lll_df.h b/subsys/bluetooth/controller/ll_sw/lll_df.h index c9c3a2fd340..7229c50bbb1 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_df.h +++ b/subsys/bluetooth/controller/ll_sw/lll_df.h @@ -4,26 +4,5 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* @brief Configuration of Constant Tone Extension for connectionless - * transmission. - */ -struct lll_df_adv_cfg { - uint8_t is_enabled:1; - uint8_t cte_length:6; /* Length of CTE in 8us units */ - uint8_t cte_type:2; - uint8_t cte_count:6; - uint8_t ant_sw_len:6; - uint8_t ant_ids[CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN]; -}; - -/* @brief Min supported length of antenna switching pattern */ -#define LLL_DF_MIN_ANT_PATTERN_LEN 3 - -/* @brief Max supported CTE length in 8us units */ -#define LLL_DF_MAX_CTE_LEN 20 - int lll_df_init(void); int lll_df_reset(void); - -/* Provides number of available antennas for Direction Finding */ -uint8_t lll_df_ant_num_get(void); diff --git a/subsys/bluetooth/controller/ll_sw/lll_df_internal.h b/subsys/bluetooth/controller/ll_sw/lll_df_internal.h new file mode 100644 index 00000000000..06a131dd0ad --- /dev/null +++ b/subsys/bluetooth/controller/ll_sw/lll_df_internal.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* @brief Configuration of Constant Tone Extension for connectionless + * transmission. + */ +struct lll_df_adv_cfg { + uint8_t is_enabled:1; + uint8_t is_started:1; + uint8_t cte_length:6; /* Length of CTE in 8us units */ + uint8_t cte_type:2; + uint8_t cte_count:6; + uint8_t ant_sw_len:6; + uint8_t ant_ids[CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN]; +}; + +/* @brief Max supported CTE length in 8us units */ +#define LLL_DF_MAX_CTE_LEN 20 +/* @brief Min supported CTE length in 8us units */ +#define LLL_DF_MIN_CTE_LEN 2 + +/* @brief Min supported length of antenna switching pattern */ +#define LLL_DF_MIN_ANT_PATTERN_LEN 3 + +/* Provides number of available antennae for Direction Finding */ +uint8_t lll_df_ant_num_get(void); diff --git a/subsys/bluetooth/controller/ll_sw/ull_df.c b/subsys/bluetooth/controller/ll_sw/ull_df.c index ff56d99afd0..33c33a63cb3 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_df.c +++ b/subsys/bluetooth/controller/ll_sw/ull_df.c @@ -25,7 +25,7 @@ #include "ull_adv_internal.h" #include "ull_df.h" -#include "lll_df.h" +#include "lll_df_internal.h" #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) #define LOG_MODULE_NAME bt_ctlr_ull_df