Skip to content

Commit 367004f

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: Controller: Conditional compile optional ticker interfaces
Conditional compile ticker interfaces like ticker_update which are not required when individual state or role samples are build. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
1 parent e48ea7e commit 367004f

File tree

2 files changed

+73
-1
lines changed

2 files changed

+73
-1
lines changed

subsys/bluetooth/controller/Kconfig.ll_sw_split

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ config BT_LLL_VENDOR_NORDIC
4343
select BT_CTLR_TIFS_HW_SUPPORT
4444
select BT_CTLR_ULL_LLL_PRIO_SUPPORT
4545

46+
select BT_TICKER_UPDATE if BT_BROADCASTER || BT_CONN || \
47+
(BT_OBSERVER && BT_CTLR_ADV_EXT)
48+
select BT_TICKER_NEXT_SLOT_GET if (BT_BROADCASTER && \
49+
BT_CTLR_ADV_EXT) || \
50+
BT_CTLR_ADV_PERIODIC
4651
select BT_TICKER_REMAINDER_GET if BT_BROADCASTER && BT_CTLR_ADV_EXT
4752
select BT_TICKER_LAZY_GET if BT_CTLR_ADV_PERIODIC
4853

@@ -58,6 +63,9 @@ config BT_LLL_VENDOR_OPENISA
5863
select BT_HAS_HCI_VS
5964
select BT_CTLR_LE_ENC_SUPPORT if !BT_CTLR_DATA_LENGTH_CLEAR
6065
select BT_CTLR_PRIVACY_SUPPORT
66+
67+
select BT_TICKER_UPDATE if BT_BROADCASTER || BT_CONN
68+
6169
default y
6270
help
6371
Use OpenISA Lower Link Layer implementation.
@@ -768,22 +776,46 @@ config BT_TICKER_LOW_LAT
768776
radio RX/TX. Enabling this option disables the ticker priority- and
769777
'must expire' features.
770778

779+
config BT_TICKER_UPDATE
780+
bool "Ticker Update"
781+
help
782+
This option enables Ticker Update interface.
783+
784+
config BT_TICKER_JOB_IDLE_GET
785+
bool "Ticker Job Idle Get"
786+
default y if BT_TICKER_LOW_LAT
787+
help
788+
This option enables the ticker interface to query the idle state of
789+
the Ticker Job execution context. This interface is used to disable
790+
Ticker Job execution once in idle state, no operations pending for the
791+
Ticker Job to process.
792+
793+
config BT_TICKER_NEXT_SLOT_GET
794+
bool "Ticker Next Slot Get"
795+
default y if BT_CENTRAL
796+
help
797+
This option enables ticker interface to iterate through active
798+
ticker nodes, returning tick to expire.
799+
771800
config BT_TICKER_REMAINDER_GET
772801
bool "Ticker Next Slot Get with Remainder"
802+
depends on BT_TICKER_NEXT_SLOT_GET
773803
help
774804
This option enables ticker interface to iterate through active
775805
ticker nodes, returning tick to expire and remainder from a reference
776806
tick.
777807

778808
config BT_TICKER_LAZY_GET
779809
bool "Ticker Next Slot Get with Lazy"
810+
depends on BT_TICKER_NEXT_SLOT_GET
780811
help
781812
This option enables ticker interface to iterate through active
782813
ticker nodes, returning tick to expire and lazy count from a reference
783814
tick.
784815

785816
config BT_TICKER_NEXT_SLOT_GET_MATCH
786817
bool "Ticker Next Slot Get with match callback"
818+
depends on BT_TICKER_NEXT_SLOT_GET
787819
default y if BT_TICKER_SLOT_AGNOSTIC
788820
help
789821
This option enables ticker interface to iterate through active

subsys/bluetooth/controller/ticker/ticker.c

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ static uint8_t ticker_by_slot_get(struct ticker_node *node, uint8_t ticker_id_he
364364
}
365365
#endif /* CONFIG_BT_TICKER_LOW_LAT */
366366

367+
#if defined(CONFIG_BT_TICKER_NEXT_SLOT_GET)
367368
/**
368369
* @brief Get next ticker with slot ticks or match
369370
*
@@ -480,6 +481,7 @@ static void ticker_by_next_slot_get(struct ticker_instance *instance,
480481
*ticker_id_head = _ticker_id_head;
481482
*ticks_to_expire = _ticks_to_expire;
482483
}
484+
#endif /* CONFIG_BT_TICKER_NEXT_SLOT_GET */
483485

484486
#if !defined(CONFIG_BT_TICKER_LOW_LAT)
485487
/**
@@ -1378,7 +1380,8 @@ static inline void ticker_job_node_manage(struct ticker_instance *instance,
13781380
uint8_t *insert_head)
13791381
{
13801382
/* Handle update of ticker by re-inserting it back. */
1381-
if (user_op->op == TICKER_USER_OP_TYPE_UPDATE) {
1383+
if (IS_ENABLED(CONFIG_BT_TICKER_UPDATE) &&
1384+
(user_op->op == TICKER_USER_OP_TYPE_UPDATE)) {
13821385
/* Remove ticker node from list */
13831386
ticker->ticks_to_expire = ticker_dequeue(instance, user_op->id);
13841387

@@ -2294,9 +2297,22 @@ static inline void ticker_job_list_insert(struct ticker_instance *instance,
22942297
}
22952298
}
22962299
}
2300+
2301+
#if !defined(CONFIG_BT_TICKER_JOB_IDLE_GET) && \
2302+
!defined(CONFIG_BT_TICKER_NEXT_SLOT_GET) && \
2303+
!defined(CONFIG_BT_TICKER_PRIORITY_SET)
2304+
user->first = user_ops_first;
2305+
#endif /* !CONFIG_BT_TICKER_JOB_IDLE_GET &&
2306+
* !CONFIG_BT_TICKER_NEXT_SLOT_GET &&
2307+
* !CONFIG_BT_TICKER_PRIORITY_SET
2308+
*/
2309+
22972310
}
22982311
}
22992312

2313+
#if defined(CONFIG_BT_TICKER_JOB_IDLE_GET) || \
2314+
defined(CONFIG_BT_TICKER_NEXT_SLOT_GET) || \
2315+
defined(CONFIG_BT_TICKER_PRIORITY_SET)
23002316
/**
23012317
* @brief Perform inquiry for specific user operation
23022318
*
@@ -2312,6 +2328,7 @@ static inline void ticker_job_op_inquire(struct ticker_instance *instance,
23122328

23132329
fp_op_func = NULL;
23142330
switch (uop->op) {
2331+
#if defined(CONFIG_BT_TICKER_NEXT_SLOT_GET)
23152332
case TICKER_USER_OP_TYPE_SLOT_GET:
23162333
ticker_by_next_slot_get(instance,
23172334
uop->params.slot_get.ticker_id,
@@ -2334,11 +2351,17 @@ static inline void ticker_job_op_inquire(struct ticker_instance *instance,
23342351
NULL);
23352352
#endif /* !CONFIG_BT_TICKER_LAZY_GET */
23362353
__fallthrough;
2354+
#endif /* CONFIG_BT_TICKER_NEXT_SLOT_GET */
23372355

2356+
#if defined(CONFIG_BT_TICKER_JOB_IDLE_GET) || \
2357+
defined(CONFIG_BT_TICKER_NEXT_SLOT_GET)
23382358
case TICKER_USER_OP_TYPE_IDLE_GET:
23392359
uop->status = TICKER_STATUS_SUCCESS;
23402360
fp_op_func = uop->fp_op_func;
23412361
break;
2362+
#endif /* CONFIG_BT_TICKER_JOB_IDLE_GET ||
2363+
* CONFIG_BT_TICKER_NEXT_SLOT_GET
2364+
*/
23422365

23432366
#if !defined(CONFIG_BT_TICKER_LOW_LAT) && \
23442367
!defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) && \
@@ -2411,6 +2434,10 @@ static inline void ticker_job_list_inquire(struct ticker_instance *instance)
24112434
}
24122435
}
24132436
}
2437+
#endif /* CONFIG_BT_TICKER_JOB_IDLE_GET ||
2438+
* CONFIG_BT_TICKER_NEXT_SLOT_GET ||
2439+
* CONFIG_BT_TICKER_PRIORITY_SET
2440+
*/
24142441

24152442
/**
24162443
* @brief Update counter compare value (trigger)
@@ -2599,11 +2626,18 @@ void ticker_job(void *param)
25992626
flag_compare_update = 1U;
26002627
}
26012628

2629+
#if defined(CONFIG_BT_TICKER_JOB_IDLE_GET) || \
2630+
defined(CONFIG_BT_TICKER_NEXT_SLOT_GET) || \
2631+
defined(CONFIG_BT_TICKER_PRIORITY_SET)
26022632
/* Process any list inquiries */
26032633
if (!pending) {
26042634
/* Handle inquiries */
26052635
ticker_job_list_inquire(instance);
26062636
}
2637+
#endif /* CONFIG_BT_TICKER_JOB_IDLE_GET ||
2638+
* CONFIG_BT_TICKER_NEXT_SLOT_GET ||
2639+
* CONFIG_BT_TICKER_PRIORITY_SET
2640+
*/
26072641

26082642
/* update compare if head changed */
26092643
if (flag_compare_update) {
@@ -2851,6 +2885,7 @@ uint32_t ticker_start(uint8_t instance_index, uint8_t user_id, uint8_t ticker_id
28512885
return user_op->status;
28522886
}
28532887

2888+
#if defined(CONFIG_BT_TICKER_UPDATE)
28542889
/**
28552890
* @brief Update a ticker node
28562891
*
@@ -2947,6 +2982,7 @@ uint32_t ticker_update_ext(uint8_t instance_index, uint8_t user_id,
29472982

29482983
return user_op->status;
29492984
}
2985+
#endif /* CONFIG_BT_TICKER_UPDATE */
29502986

29512987
/**
29522988
* @brief Yield a ticker node with supplied absolute ticks reference
@@ -3110,6 +3146,7 @@ uint32_t ticker_stop_abs(uint8_t instance_index, uint8_t user_id,
31103146
return user_op->status;
31113147
}
31123148

3149+
#if defined(CONFIG_BT_TICKER_NEXT_SLOT_GET)
31133150
/**
31143151
* @brief Get next ticker node slot
31153152
*
@@ -3202,7 +3239,9 @@ uint32_t ticker_next_slot_get_ext(uint8_t instance_index, uint8_t user_id,
32023239

32033240
return user_op->status;
32043241
}
3242+
#endif /* CONFIG_BT_TICKER_NEXT_SLOT_GET */
32053243

3244+
#if defined(CONFIG_BT_TICKER_JOB_IDLE_GET)
32063245
/**
32073246
* @brief Get a callback at the end of ticker job execution
32083247
*
@@ -3254,6 +3293,7 @@ uint32_t ticker_job_idle_get(uint8_t instance_index, uint8_t user_id,
32543293

32553294
return user_op->status;
32563295
}
3296+
#endif /* CONFIG_BT_TICKER_JOB_IDLE_GET */
32573297

32583298
#if !defined(CONFIG_BT_TICKER_LOW_LAT) && \
32593299
!defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) && \

0 commit comments

Comments
 (0)