Commit a3e8f83e authored by Vinayak Kariappa Chettimada's avatar Vinayak Kariappa Chettimada Committed by Anas Nashif
Browse files

Bluetooth: Controller: Use defines for aux pointer offset unit value



Use defines for aux pointer offset unit value.

Signed-off-by: default avatarVinayak Kariappa Chettimada <vich@nordicsemi.no>
parent e8929c33
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -438,10 +438,10 @@ static void pdu_b2b_aux_ptr_update(struct pdu_adv *pdu, uint8_t phy, uint8_t fla
	offset_us = offset_us / OFFS_UNIT_30_US;
	if ((offset_us >> 13) != 0) {
		aux_ptr->offs = offset_us / (OFFS_UNIT_300_US / OFFS_UNIT_30_US);
		aux_ptr->offs_units = 1U;
		aux_ptr->offs_units = OFFS_UNIT_VALUE_300_US;
	} else {
		aux_ptr->offs = offset_us;
		aux_ptr->offs_units = 0U;
		aux_ptr->offs_units = OFFS_UNIT_VALUE_30_US;
	}
	aux_ptr->chan_idx = chan_idx;
	aux_ptr->ca = (lll_clock_ppm_local_get() <= SCA_50_PPM) ?
+5 −3
Original line number Diff line number Diff line
@@ -105,6 +105,8 @@
/* Offset Units field encoding */
#define OFFS_UNIT_30_US        30
#define OFFS_UNIT_300_US       300
#define OFFS_UNIT_VALUE_30_US  0
#define OFFS_UNIT_VALUE_300_US 1
/* Value specified in BT Spec. Vol 6, Part B, section 2.3.4.6 */
#define OFFS_ADJUST_US         245760

+3 −3
Original line number Diff line number Diff line
@@ -954,7 +954,7 @@ void ull_adv_aux_ptr_fill(uint8_t **dptr, uint8_t phy_s)
	aux_ptr->ca = (lll_clock_ppm_local_get() <= SCA_50_PPM) ?
		      SCA_VALUE_50_PPM : SCA_VALUE_500_PPM;

	aux_ptr->offs_units = 0U;
	aux_ptr->offs_units = OFFS_UNIT_VALUE_30_US;
	aux_ptr->offs = 0U;

	aux_ptr->phy = find_lsb_set(phy_s) - 1;
@@ -1143,10 +1143,10 @@ struct pdu_adv_aux_ptr *ull_adv_aux_lll_offset_fill(struct pdu_adv *pdu,
	offs = offs / OFFS_UNIT_30_US;
	if (!!(offs >> 13)) {
		aux_ptr->offs = offs / (OFFS_UNIT_300_US / OFFS_UNIT_30_US);
		aux_ptr->offs_units = 1U;
		aux_ptr->offs_units = OFFS_UNIT_VALUE_300_US;
	} else {
		aux_ptr->offs = offs;
		aux_ptr->offs_units = 0U;
		aux_ptr->offs_units = OFFS_UNIT_VALUE_30_US;
	}

	return aux_ptr;
+3 −3
Original line number Diff line number Diff line
@@ -903,7 +903,7 @@ void ull_adv_sync_info_fill(struct ll_adv_sync_set *sync,
	 * If sync_info is part of ADV PDU the offs_adjust field
	 * is always set to 0.
	 */
	si->offs_units = 0U;
	si->offs_units = OFFS_UNIT_VALUE_30_US;
	si->offs_adjust = 0U;
	si->offs = 0U;

@@ -1610,10 +1610,10 @@ static inline void sync_info_offset_fill(struct pdu_adv_sync_info *si,
	offs = offs / OFFS_UNIT_30_US;
	if (!!(offs >> 13)) {
		si->offs = offs / (OFFS_UNIT_300_US / OFFS_UNIT_30_US);
		si->offs_units = 1U;
		si->offs_units = OFFS_UNIT_VALUE_300_US;
	} else {
		si->offs = offs;
		si->offs_units = 0U;
		si->offs_units = OFFS_UNIT_VALUE_30_US;
	}
}