Commit df67f4ec authored by Troels Nilsson's avatar Troels Nilsson Committed by Carles Cufi
Browse files

Bluetooth: Controller: Fix building ticker without remainder support

A few things were not flagged by CONFIG_BT_TICKER_REMAINDER_SUPPORT
that should have been; This caused building without it to fail

Initialize remainder to 0 where used with ticker_next_slot_get_ext(),
since it may not get set if remainder support is off

Signed-off-by: default avatarTroels Nilsson <trnn@demant.com>
parent 789e3f34
Loading
Loading
Loading
Loading
+3 −1
Changes for subsys/bluetooth/controller/ll_sw/ull_adv.c: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2381,14 +2381,16 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift,
	defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO)
		if (adv->lll.aux) {
			uint32_t ticks_to_expire;
			uint32_t other_remainder;
			uint32_t other_remainder = 0U;

			LL_ASSERT(context->other_expire_info);

			/* Adjust ticks to expire based on remainder value */
			ticks_to_expire = context->other_expire_info->ticks_to_expire;
#if defined(CONFIG_BT_TICKER_REMAINDER_SUPPORT)
			other_remainder = context->other_expire_info->remainder;
			hal_ticker_remove_jitter(&ticks_to_expire, &other_remainder);
#endif /* CONFIG_BT_TICKER_REMAINDER_SUPPORT */

			/* Store the ticks and remainder offset for aux ptr population in LLL */
			adv->lll.aux->ticks_pri_pdu_offset = ticks_to_expire;
+12 −2
Changes for subsys/bluetooth/controller/ll_sw/ull_adv_aux.c: 12 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -3197,7 +3197,7 @@ static void mfy_aux_offset_get(void *param)
	uint16_t chan_counter;
	struct pdu_adv *pdu;
	uint32_t ticks_now;
	uint32_t remainder;
	uint32_t remainder = 0U;
	uint32_t offset_us;
	uint8_t ticker_id;
	uint16_t pdu_us;
@@ -3222,12 +3222,20 @@ static void mfy_aux_offset_get(void *param)
		ticks_previous = ticks_current;

		ret_cb = TICKER_STATUS_BUSY;
#if defined(CONFIG_BT_TICKER_REMAINDER_SUPPORT)
		ret = ticker_next_slot_get_ext(TICKER_INSTANCE_ID_CTLR,
					       TICKER_USER_ID_ULL_LOW,
					       &id, &ticks_current,
					       &ticks_to_expire, &remainder,
					       NULL, NULL, NULL,
					       ticker_op_cb, (void *)&ret_cb);
#else /* CONFIG_BT_TICKER_REMAINDER_SUPPORT */
		ret = ticker_next_slot_get(TICKER_INSTANCE_ID_CTLR,
					   TICKER_USER_ID_ULL_LOW,
					   &id, &ticks_current,
					   &ticks_to_expire,
					   ticker_op_cb, (void *)&ret_cb);
#endif /* !CONFIG_BT_TICKER_REMAINDER_SUPPORT */
		if (ret == TICKER_STATUS_BUSY) {
			while (ret_cb == TICKER_STATUS_BUSY) {
				ticker_job_sched(TICKER_INSTANCE_ID_CTLR,
@@ -3369,7 +3377,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift,
		sync = HDR_LLL2ULL(adv->lll.sync);
		if (sync->is_started) {
			uint32_t ticks_to_expire;
			uint32_t sync_remainder_us;
			uint32_t sync_remainder_us = 0U;

			LL_ASSERT(context->other_expire_info);

@@ -3377,6 +3385,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift,
			 * value.
			 */
			ticks_to_expire = context->other_expire_info->ticks_to_expire;
#if defined(CONFIG_BT_TICKER_REMAINDER_SUPPORT)
			sync_remainder_us = context->other_expire_info->remainder;
			hal_ticker_remove_jitter(&ticks_to_expire, &sync_remainder_us);

@@ -3384,6 +3393,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift,
			 * value.
			 */
			hal_ticker_add_jitter(&ticks_to_expire, &remainder);
#endif /* CONFIG_BT_TICKER_REMAINDER_SUPPORT */

			/* Store the offset in us */
			lll_sync->us_adv_sync_pdu_offset = HAL_TICKER_TICKS_TO_US(ticks_to_expire) +
+1 −1
Changes for subsys/bluetooth/controller/ll_sw/ull_adv_sync.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -2690,7 +2690,7 @@ static void mfy_sync_offset_get(void *param)
	uint32_t ticks_to_expire;
	uint32_t ticks_current;
	struct pdu_adv *pdu;
	uint32_t remainder;
	uint32_t remainder = 0U;
	uint8_t chm_first;
	uint8_t ticker_id;
	uint16_t lazy;
+1 −1
Changes for subsys/bluetooth/controller/ll_sw/ull_central_iso.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -1090,7 +1090,7 @@ static void mfy_cis_offset_get(void *param)
	uint32_t ticks_current;
	uint32_t offset_min_us;
	struct ll_conn *conn;
	uint32_t remainder;
	uint32_t remainder = 0U;
	uint8_t ticker_id;
	uint16_t lazy;
	uint8_t retry;
+1 −1
Changes for subsys/bluetooth/controller/ll_sw/ull_conn.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -2744,7 +2744,7 @@ static uint32_t get_ticker_offset(uint8_t ticker_id, uint16_t *lazy)
	uint32_t ticks_to_expire;
	uint32_t ticks_current;
	uint32_t sync_remainder_us;
	uint32_t remainder;
	uint32_t remainder = 0U;
	uint32_t start_us;
	uint32_t ret;
	uint8_t id;
Loading