Skip to content

Commit f9dd4c2

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: controller: Facilitate reuse of BT_CTLR_MAX_CONNECTABLE
Minor rearrange order of definition BT_CTLR_MAX_CONNECTABLE to better reuse it. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent fc47320 commit f9dd4c2

File tree

1 file changed

+16
-16
lines changed
  • subsys/bluetooth/controller/ll_sw

1 file changed

+16
-16
lines changed

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@
6363
#include "common/log.h"
6464
#include "hal/debug.h"
6565

66+
/* When both central and peripheral are supported, one each Rx node will be
67+
* needed by connectable advertising and the initiator to generate connection
68+
* complete event, hence conditionally set the count.
69+
*/
70+
#if defined(CONFIG_BT_MAX_CONN)
71+
#if defined(CONFIG_BT_CENTRAL) && defined(CONFIG_BT_PERIPHERAL)
72+
#define BT_CTLR_MAX_CONNECTABLE 2
73+
#else
74+
#define BT_CTLR_MAX_CONNECTABLE 1
75+
#endif
76+
#define BT_CTLR_MAX_CONN CONFIG_BT_MAX_CONN
77+
#else
78+
#define BT_CTLR_MAX_CONNECTABLE 0
79+
#define BT_CTLR_MAX_CONN 0
80+
#endif
81+
6682
#if !defined(TICKER_USER_LLL_VENDOR_OPS)
6783
#define TICKER_USER_LLL_VENDOR_OPS 0
6884
#endif /* TICKER_USER_LLL_VENDOR_OPS */
@@ -246,22 +262,6 @@ static MFIFO_DEFINE(pdu_rx_free, sizeof(void *), PDU_RX_CNT);
246262
PDU_RX_USER_PDU_OCTETS_MAX) \
247263
)
248264

249-
/* When both central and peripheral are supported, one each Rx node will be
250-
* needed by connectable advertising and the initiator to generate connection
251-
* complete event, hence conditionally set the count.
252-
*/
253-
#if defined(CONFIG_BT_MAX_CONN)
254-
#if defined(CONFIG_BT_CENTRAL) && defined(CONFIG_BT_PERIPHERAL)
255-
#define BT_CTLR_MAX_CONNECTABLE 2
256-
#else
257-
#define BT_CTLR_MAX_CONNECTABLE 1
258-
#endif
259-
#define BT_CTLR_MAX_CONN CONFIG_BT_MAX_CONN
260-
#else
261-
#define BT_CTLR_MAX_CONNECTABLE 0
262-
#define BT_CTLR_MAX_CONN 0
263-
#endif
264-
265265
#if defined(CONFIG_BT_CTLR_SCAN_SYNC_SET)
266266
#define BT_CTLR_SCAN_SYNC_SET CONFIG_BT_CTLR_SCAN_SYNC_SET
267267
#else

0 commit comments

Comments
 (0)