Skip to content

Commit eebdb3b

Browse files
cvinayakAnas Nashif
authored andcommitted
Bluetooth: controller: Internal document purpose of end capture
Document internal the purposes of various Tx/Rx PDU end capture setup. Also, removed any redundant capture of packet end. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 4d01527 commit eebdb3b

File tree

1 file changed

+25
-2
lines changed
  • subsys/bluetooth/controller/ll_sw

1 file changed

+25
-2
lines changed

subsys/bluetooth/controller/ll_sw/ctrl.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,10 @@ static inline void isr_radio_state_tx(void)
626626
hcto -= radio_tx_chain_delay_get(0, 0);
627627

628628
radio_tmr_hcto_configure(hcto);
629+
630+
/* capture end of CONNECT_IND PDU, used for calculating first
631+
* slave event.
632+
*/
629633
radio_tmr_end_capture();
630634

631635
#if defined(CONFIG_BT_CTLR_SCAN_REQ_RSSI)
@@ -698,7 +702,10 @@ static inline void isr_radio_state_tx(void)
698702
#endif /* !CONFIG_BT_CTLR_PHY */
699703

700704
radio_tmr_hcto_configure(hcto);
705+
706+
#if defined(CONFIG_BT_CTLR_PROFILE_ISR)
701707
radio_tmr_end_capture();
708+
#endif /* CONFIG_BT_CTLR_PROFILE_ISR */
702709

703710
/* Route the tx packet to respective connections */
704711
/* TODO: use timebox for tx enqueue (instead of 1 packet
@@ -1405,8 +1412,6 @@ static inline u32_t isr_rx_scan(u8_t devmatch_ok, u8_t devmatch_id,
14051412
/* assert if radio packet ptr is not set and radio started tx */
14061413
LL_ASSERT(!radio_is_ready());
14071414

1408-
radio_tmr_end_capture();
1409-
14101415
/* block CPU so that there is no CRC error on pdu tx,
14111416
* this is only needed if we want the CPU to sleep.
14121417
* while(!radio_has_disabled())
@@ -1604,6 +1609,8 @@ static inline u32_t isr_rx_scan(u8_t devmatch_ok, u8_t devmatch_id,
16041609
radio_tmr_tifs_set(RADIO_TIFS);
16051610
radio_switch_complete_and_rx(0);
16061611
radio_pkt_tx_set(pdu_adv_tx);
1612+
1613+
/* capture end of Tx-ed PDU, used to calculate HCTO. */
16071614
radio_tmr_end_capture();
16081615

16091616
/* assert if radio packet ptr is not set and radio started tx */
@@ -3351,6 +3358,7 @@ static inline void isr_rx_conn(u8_t crc_ok, u8_t trx_done,
33513358
radio_switch_complete_and_rx(0);
33523359
#endif /* !CONFIG_BT_CTLR_PHY */
33533360

3361+
/* capture end of Tx-ed PDU, used to calculate HCTO. */
33543362
radio_tmr_end_capture();
33553363
}
33563364

@@ -3568,6 +3576,7 @@ static inline u32_t isr_close_adv(void)
35683576

35693577
radio_tx_enable();
35703578

3579+
/* capture end of Tx-ed PDU, used to calculate HCTO. */
35713580
radio_tmr_end_capture();
35723581
} else {
35733582
struct pdu_adv *pdu_adv;
@@ -3633,6 +3642,9 @@ static inline u32_t isr_close_scan(void)
36333642

36343643
radio_rx_enable();
36353644

3645+
/* capture end of Rx-ed PDU, for initiator to calculate first
3646+
* master event.
3647+
*/
36363648
radio_tmr_end_capture();
36373649
} else {
36383650
radio_filter_disable();
@@ -5705,6 +5717,8 @@ static void event_adv(u32_t ticks_at_expire, u32_t remainder,
57055717
ticks_at_expire +
57065718
TICKER_US_TO_TICKS(RADIO_TICKER_START_PART_US),
57075719
_radio.remainder_anchor);
5720+
5721+
/* capture end of Tx-ed PDU, used to calculate HCTO. */
57085722
radio_tmr_end_capture();
57095723

57105724
#if (defined(CONFIG_BT_CTLR_XTAL_ADVANCED) && \
@@ -6061,6 +6075,10 @@ static void event_scan(u32_t ticks_at_expire, u32_t remainder, u16_t lazy,
60616075
ticks_at_expire +
60626076
TICKER_US_TO_TICKS(RADIO_TICKER_START_PART_US),
60636077
_radio.remainder_anchor);
6078+
6079+
/* capture end of Rx-ed PDU, for initiator to calculate first
6080+
* master event.
6081+
*/
60646082
radio_tmr_end_capture();
60656083

60666084
#if (defined(CONFIG_BT_CTLR_XTAL_ADVANCED) && \
@@ -7825,7 +7843,10 @@ static void event_slave(u32_t ticks_at_expire, u32_t remainder, u16_t lazy,
78257843
#endif /* !CONFIG_BT_CTLR_PHY */
78267844

78277845
radio_tmr_hcto_configure(hcto);
7846+
7847+
#if defined(CONFIG_BT_CTLR_PROFILE_ISR)
78287848
radio_tmr_end_capture();
7849+
#endif /* CONFIG_BT_CTLR_PROFILE_ISR */
78297850

78307851
#if defined(CONFIG_BT_CTLR_CONN_RSSI)
78317852
radio_rssi_measure();
@@ -7952,6 +7973,8 @@ static void event_master(u32_t ticks_at_expire, u32_t remainder, u16_t lazy,
79527973
radio_tmr_start(1, ticks_at_expire +
79537974
TICKER_US_TO_TICKS(RADIO_TICKER_START_PART_US),
79547975
_radio.remainder_anchor);
7976+
7977+
/* capture end of Tx-ed PDU, used to calculate HCTO. */
79557978
radio_tmr_end_capture();
79567979
#if SILENT_CONNECTION
79577980
/* silent connection! */

0 commit comments

Comments
 (0)