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>
This commit is contained in:
Vinayak Kariappa Chettimada 2022-10-05 16:40:12 +05:30 committed by Carles Cufí
commit 367004fd57
2 changed files with 73 additions and 1 deletions

View file

@ -43,6 +43,11 @@ config BT_LLL_VENDOR_NORDIC
select BT_CTLR_TIFS_HW_SUPPORT select BT_CTLR_TIFS_HW_SUPPORT
select BT_CTLR_ULL_LLL_PRIO_SUPPORT select BT_CTLR_ULL_LLL_PRIO_SUPPORT
select BT_TICKER_UPDATE if BT_BROADCASTER || BT_CONN || \
(BT_OBSERVER && BT_CTLR_ADV_EXT)
select BT_TICKER_NEXT_SLOT_GET if (BT_BROADCASTER && \
BT_CTLR_ADV_EXT) || \
BT_CTLR_ADV_PERIODIC
select BT_TICKER_REMAINDER_GET if BT_BROADCASTER && BT_CTLR_ADV_EXT select BT_TICKER_REMAINDER_GET if BT_BROADCASTER && BT_CTLR_ADV_EXT
select BT_TICKER_LAZY_GET if BT_CTLR_ADV_PERIODIC select BT_TICKER_LAZY_GET if BT_CTLR_ADV_PERIODIC
@ -58,6 +63,9 @@ config BT_LLL_VENDOR_OPENISA
select BT_HAS_HCI_VS select BT_HAS_HCI_VS
select BT_CTLR_LE_ENC_SUPPORT if !BT_CTLR_DATA_LENGTH_CLEAR select BT_CTLR_LE_ENC_SUPPORT if !BT_CTLR_DATA_LENGTH_CLEAR
select BT_CTLR_PRIVACY_SUPPORT select BT_CTLR_PRIVACY_SUPPORT
select BT_TICKER_UPDATE if BT_BROADCASTER || BT_CONN
default y default y
help help
Use OpenISA Lower Link Layer implementation. Use OpenISA Lower Link Layer implementation.
@ -768,8 +776,30 @@ config BT_TICKER_LOW_LAT
radio RX/TX. Enabling this option disables the ticker priority- and radio RX/TX. Enabling this option disables the ticker priority- and
'must expire' features. 'must expire' features.
config BT_TICKER_UPDATE
bool "Ticker Update"
help
This option enables Ticker Update interface.
config BT_TICKER_JOB_IDLE_GET
bool "Ticker Job Idle Get"
default y if BT_TICKER_LOW_LAT
help
This option enables the ticker interface to query the idle state of
the Ticker Job execution context. This interface is used to disable
Ticker Job execution once in idle state, no operations pending for the
Ticker Job to process.
config BT_TICKER_NEXT_SLOT_GET
bool "Ticker Next Slot Get"
default y if BT_CENTRAL
help
This option enables ticker interface to iterate through active
ticker nodes, returning tick to expire.
config BT_TICKER_REMAINDER_GET config BT_TICKER_REMAINDER_GET
bool "Ticker Next Slot Get with Remainder" bool "Ticker Next Slot Get with Remainder"
depends on BT_TICKER_NEXT_SLOT_GET
help help
This option enables ticker interface to iterate through active This option enables ticker interface to iterate through active
ticker nodes, returning tick to expire and remainder from a reference ticker nodes, returning tick to expire and remainder from a reference
@ -777,6 +807,7 @@ config BT_TICKER_REMAINDER_GET
config BT_TICKER_LAZY_GET config BT_TICKER_LAZY_GET
bool "Ticker Next Slot Get with Lazy" bool "Ticker Next Slot Get with Lazy"
depends on BT_TICKER_NEXT_SLOT_GET
help help
This option enables ticker interface to iterate through active This option enables ticker interface to iterate through active
ticker nodes, returning tick to expire and lazy count from a reference ticker nodes, returning tick to expire and lazy count from a reference
@ -784,6 +815,7 @@ config BT_TICKER_LAZY_GET
config BT_TICKER_NEXT_SLOT_GET_MATCH config BT_TICKER_NEXT_SLOT_GET_MATCH
bool "Ticker Next Slot Get with match callback" bool "Ticker Next Slot Get with match callback"
depends on BT_TICKER_NEXT_SLOT_GET
default y if BT_TICKER_SLOT_AGNOSTIC default y if BT_TICKER_SLOT_AGNOSTIC
help help
This option enables ticker interface to iterate through active This option enables ticker interface to iterate through active

View file

@ -364,6 +364,7 @@ static uint8_t ticker_by_slot_get(struct ticker_node *node, uint8_t ticker_id_he
} }
#endif /* CONFIG_BT_TICKER_LOW_LAT */ #endif /* CONFIG_BT_TICKER_LOW_LAT */
#if defined(CONFIG_BT_TICKER_NEXT_SLOT_GET)
/** /**
* @brief Get next ticker with slot ticks or match * @brief Get next ticker with slot ticks or match
* *
@ -480,6 +481,7 @@ static void ticker_by_next_slot_get(struct ticker_instance *instance,
*ticker_id_head = _ticker_id_head; *ticker_id_head = _ticker_id_head;
*ticks_to_expire = _ticks_to_expire; *ticks_to_expire = _ticks_to_expire;
} }
#endif /* CONFIG_BT_TICKER_NEXT_SLOT_GET */
#if !defined(CONFIG_BT_TICKER_LOW_LAT) #if !defined(CONFIG_BT_TICKER_LOW_LAT)
/** /**
@ -1378,7 +1380,8 @@ static inline void ticker_job_node_manage(struct ticker_instance *instance,
uint8_t *insert_head) uint8_t *insert_head)
{ {
/* Handle update of ticker by re-inserting it back. */ /* Handle update of ticker by re-inserting it back. */
if (user_op->op == TICKER_USER_OP_TYPE_UPDATE) { if (IS_ENABLED(CONFIG_BT_TICKER_UPDATE) &&
(user_op->op == TICKER_USER_OP_TYPE_UPDATE)) {
/* Remove ticker node from list */ /* Remove ticker node from list */
ticker->ticks_to_expire = ticker_dequeue(instance, user_op->id); ticker->ticks_to_expire = ticker_dequeue(instance, user_op->id);
@ -2294,9 +2297,22 @@ static inline void ticker_job_list_insert(struct ticker_instance *instance,
} }
} }
} }
#if !defined(CONFIG_BT_TICKER_JOB_IDLE_GET) && \
!defined(CONFIG_BT_TICKER_NEXT_SLOT_GET) && \
!defined(CONFIG_BT_TICKER_PRIORITY_SET)
user->first = user_ops_first;
#endif /* !CONFIG_BT_TICKER_JOB_IDLE_GET &&
* !CONFIG_BT_TICKER_NEXT_SLOT_GET &&
* !CONFIG_BT_TICKER_PRIORITY_SET
*/
} }
} }
#if defined(CONFIG_BT_TICKER_JOB_IDLE_GET) || \
defined(CONFIG_BT_TICKER_NEXT_SLOT_GET) || \
defined(CONFIG_BT_TICKER_PRIORITY_SET)
/** /**
* @brief Perform inquiry for specific user operation * @brief Perform inquiry for specific user operation
* *
@ -2312,6 +2328,7 @@ static inline void ticker_job_op_inquire(struct ticker_instance *instance,
fp_op_func = NULL; fp_op_func = NULL;
switch (uop->op) { switch (uop->op) {
#if defined(CONFIG_BT_TICKER_NEXT_SLOT_GET)
case TICKER_USER_OP_TYPE_SLOT_GET: case TICKER_USER_OP_TYPE_SLOT_GET:
ticker_by_next_slot_get(instance, ticker_by_next_slot_get(instance,
uop->params.slot_get.ticker_id, uop->params.slot_get.ticker_id,
@ -2334,11 +2351,17 @@ static inline void ticker_job_op_inquire(struct ticker_instance *instance,
NULL); NULL);
#endif /* !CONFIG_BT_TICKER_LAZY_GET */ #endif /* !CONFIG_BT_TICKER_LAZY_GET */
__fallthrough; __fallthrough;
#endif /* CONFIG_BT_TICKER_NEXT_SLOT_GET */
#if defined(CONFIG_BT_TICKER_JOB_IDLE_GET) || \
defined(CONFIG_BT_TICKER_NEXT_SLOT_GET)
case TICKER_USER_OP_TYPE_IDLE_GET: case TICKER_USER_OP_TYPE_IDLE_GET:
uop->status = TICKER_STATUS_SUCCESS; uop->status = TICKER_STATUS_SUCCESS;
fp_op_func = uop->fp_op_func; fp_op_func = uop->fp_op_func;
break; break;
#endif /* CONFIG_BT_TICKER_JOB_IDLE_GET ||
* CONFIG_BT_TICKER_NEXT_SLOT_GET
*/
#if !defined(CONFIG_BT_TICKER_LOW_LAT) && \ #if !defined(CONFIG_BT_TICKER_LOW_LAT) && \
!defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) && \ !defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) && \
@ -2411,6 +2434,10 @@ static inline void ticker_job_list_inquire(struct ticker_instance *instance)
} }
} }
} }
#endif /* CONFIG_BT_TICKER_JOB_IDLE_GET ||
* CONFIG_BT_TICKER_NEXT_SLOT_GET ||
* CONFIG_BT_TICKER_PRIORITY_SET
*/
/** /**
* @brief Update counter compare value (trigger) * @brief Update counter compare value (trigger)
@ -2599,11 +2626,18 @@ void ticker_job(void *param)
flag_compare_update = 1U; flag_compare_update = 1U;
} }
#if defined(CONFIG_BT_TICKER_JOB_IDLE_GET) || \
defined(CONFIG_BT_TICKER_NEXT_SLOT_GET) || \
defined(CONFIG_BT_TICKER_PRIORITY_SET)
/* Process any list inquiries */ /* Process any list inquiries */
if (!pending) { if (!pending) {
/* Handle inquiries */ /* Handle inquiries */
ticker_job_list_inquire(instance); ticker_job_list_inquire(instance);
} }
#endif /* CONFIG_BT_TICKER_JOB_IDLE_GET ||
* CONFIG_BT_TICKER_NEXT_SLOT_GET ||
* CONFIG_BT_TICKER_PRIORITY_SET
*/
/* update compare if head changed */ /* update compare if head changed */
if (flag_compare_update) { if (flag_compare_update) {
@ -2851,6 +2885,7 @@ uint32_t ticker_start(uint8_t instance_index, uint8_t user_id, uint8_t ticker_id
return user_op->status; return user_op->status;
} }
#if defined(CONFIG_BT_TICKER_UPDATE)
/** /**
* @brief Update a ticker node * @brief Update a ticker node
* *
@ -2947,6 +2982,7 @@ uint32_t ticker_update_ext(uint8_t instance_index, uint8_t user_id,
return user_op->status; return user_op->status;
} }
#endif /* CONFIG_BT_TICKER_UPDATE */
/** /**
* @brief Yield a ticker node with supplied absolute ticks reference * @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,
return user_op->status; return user_op->status;
} }
#if defined(CONFIG_BT_TICKER_NEXT_SLOT_GET)
/** /**
* @brief Get next ticker node slot * @brief Get next ticker node slot
* *
@ -3202,7 +3239,9 @@ uint32_t ticker_next_slot_get_ext(uint8_t instance_index, uint8_t user_id,
return user_op->status; return user_op->status;
} }
#endif /* CONFIG_BT_TICKER_NEXT_SLOT_GET */
#if defined(CONFIG_BT_TICKER_JOB_IDLE_GET)
/** /**
* @brief Get a callback at the end of ticker job execution * @brief Get a callback at the end of ticker job execution
* *
@ -3254,6 +3293,7 @@ uint32_t ticker_job_idle_get(uint8_t instance_index, uint8_t user_id,
return user_op->status; return user_op->status;
} }
#endif /* CONFIG_BT_TICKER_JOB_IDLE_GET */
#if !defined(CONFIG_BT_TICKER_LOW_LAT) && \ #if !defined(CONFIG_BT_TICKER_LOW_LAT) && \
!defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) && \ !defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) && \