Skip to content
Permalink
Browse files

Bluetooth: controller: split: Refactor if_defines to is_enabled in lll.c

This commit refactors if defines to use the macro is_enabled,
for readability

Signed-off-by: Alexander Svensen <alsv@nordicsemi.no>
  • Loading branch information...
Alexander Svensen authored and aescolar committed May 16, 2019
1 parent 6f79b01 commit 63a93e8b5ae3777bb14261c8a2048cdb37ce6e1e
Showing with 11 additions and 11 deletions.
  1. +11 −11 subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c
@@ -221,16 +221,16 @@ void lll_disable(void *param)
int lll_prepare_done(void *param)
{
#if defined(CONFIG_BT_CTLR_LOW_LAT) && \
(CONFIG_BT_CTLR_LLL_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO)
(CONFIG_BT_CTLR_LLL_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO)
u32_t ret;

/* Ticker Job Silence */
ret = ticker_job_idle_get(TICKER_INSTANCE_ID_CTLR,
TICKER_USER_ID_LLL,
ticker_op_job_disable, NULL);

return ((ret == TICKER_STATUS_SUCCESS) || (ret == TICKER_STATUS_BUSY)) ?
0 : -EFAULT;
return ((ret == TICKER_STATUS_SUCCESS) ||
(ret == TICKER_STATUS_BUSY)) ? 0 : -EFAULT;
#else
return 0;
#endif /* CONFIG_BT_CTLR_LOW_LAT */
@@ -258,10 +258,12 @@ int lll_done(void *param)
ull = HDR_ULL(((struct lll_hdr *)param)->parent);
}

#if defined(CONFIG_BT_CTLR_LOW_LAT) && \
(CONFIG_BT_CTLR_LLL_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO)
mayfly_enable(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_LOW, 1);
#endif /* CONFIG_BT_CTLR_LOW_LAT */
if (IS_ENABLED(CONFIG_BT_CTLR_LOW_LAT) &&
(CONFIG_BT_CTLR_LLL_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO)) {
mayfly_enable(TICKER_USER_ID_LLL,
TICKER_USER_ID_ULL_LOW,
1);
}

DEBUG_RADIO_CLOSE(0);
} else {
@@ -408,12 +410,10 @@ static int prepare(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb,
#endif /* CONFIG_BT_CTLR_LOW_LAT */
int ret;

#if defined(CONFIG_BT_CTLR_LOW_LAT)
/* early abort */
if (event.curr.param) {
if (IS_ENABLED(CONFIG_BT_CTLR_LOW_LAT) && event.curr.param) {
/* early abort */
event.curr.abort_cb(NULL, event.curr.param);
}
#endif /* CONFIG_BT_CTLR_LOW_LAT */

/* Store the next prepare for deferred call */
ret = ull_prepare_enqueue(is_abort_cb, abort_cb, prepare_param,

0 comments on commit 63a93e8

Please sign in to comment.
You can’t perform that action at this time.