Bluetooth: controller: legacy: Fix missing first conn event

Fix missing first connection event due to first connection
event ticks_slot overlapping with the initiator window
ticks_slot.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2020-02-24 13:43:55 +05:30 committed by Carles Cufí
commit 8a294a62d4

View file

@ -1035,6 +1035,7 @@ static inline u32_t isr_rx_adv(u8_t devmatch_ok, u8_t devmatch_id,
u32_t conn_offset_us; u32_t conn_offset_us;
u32_t rx_ready_delay; u32_t rx_ready_delay;
u32_t ticker_status; u32_t ticker_status;
u32_t ticks_at_stop;
if (IS_ENABLED(CONFIG_BT_CTLR_CHAN_SEL_2)) { if (IS_ENABLED(CONFIG_BT_CTLR_CHAN_SEL_2)) {
node_rx = packet_rx_reserve_get(4); node_rx = packet_rx_reserve_get(4);
@ -1232,11 +1233,16 @@ static inline u32_t isr_rx_adv(u8_t devmatch_ok, u8_t devmatch_id,
#endif #endif
/* Stop Advertiser */ /* Stop Advertiser */
ticker_status = ticker_stop(RADIO_TICKER_INSTANCE_ID_RADIO, ticks_at_stop = _radio.ticks_anchor +
RADIO_TICKER_USER_ID_WORKER, HAL_TICKER_US_TO_TICKS(RADIO_TICKER_START_PART_US +
RADIO_TICKER_ID_ADV, radio_tmr_end_get()) -
ticker_stop_adv_assert, ticks_slot_offset;
(void *)__LINE__); ticker_status = ticker_stop_abs(RADIO_TICKER_INSTANCE_ID_RADIO,
RADIO_TICKER_USER_ID_WORKER,
RADIO_TICKER_ID_ADV,
ticks_at_stop,
ticker_stop_adv_assert,
(void *)__LINE__);
ticker_stop_adv_assert(ticker_status, (void *)__LINE__); ticker_stop_adv_assert(ticker_status, (void *)__LINE__);
/* Stop Direct Adv Stopper */ /* Stop Direct Adv Stopper */
@ -1477,6 +1483,7 @@ static inline u32_t isr_rx_scan(u8_t devmatch_ok, u8_t devmatch_id,
u32_t conn_offset_us; u32_t conn_offset_us;
u32_t ticker_status; u32_t ticker_status;
u32_t conn_space_us; u32_t conn_space_us;
u32_t ticks_at_stop;
#if defined(CONFIG_BT_CTLR_PRIVACY) #if defined(CONFIG_BT_CTLR_PRIVACY)
bt_addr_t *lrpa; bt_addr_t *lrpa;
#endif /* CONFIG_BT_CTLR_PRIVACY */ #endif /* CONFIG_BT_CTLR_PRIVACY */
@ -1724,11 +1731,16 @@ static inline u32_t isr_rx_scan(u8_t devmatch_ok, u8_t devmatch_id,
#endif #endif
/* Stop Scanner */ /* Stop Scanner */
ticker_status = ticker_stop(RADIO_TICKER_INSTANCE_ID_RADIO, ticks_at_stop = _radio.ticks_anchor +
RADIO_TICKER_USER_ID_WORKER, HAL_TICKER_US_TO_TICKS(RADIO_TICKER_START_PART_US +
RADIO_TICKER_ID_SCAN, conn_offset_us - 1250) -
ticker_stop_scan_assert, ticks_slot_offset;
(void *)__LINE__); ticker_status = ticker_stop_abs(RADIO_TICKER_INSTANCE_ID_RADIO,
RADIO_TICKER_USER_ID_WORKER,
RADIO_TICKER_ID_SCAN,
ticks_at_stop,
ticker_stop_scan_assert,
(void *)__LINE__);
ticker_stop_scan_assert(ticker_status, (void *)__LINE__); ticker_stop_scan_assert(ticker_status, (void *)__LINE__);
/* Scanner stop can expire while here in this ISR. /* Scanner stop can expire while here in this ISR.