@@ -546,6 +546,8 @@ static void isr_tx(void *param)
546
546
if (se_curr < cis_lll -> nse ) {
547
547
const struct lll_conn * evt_conn_lll ;
548
548
uint16_t data_chan_id ;
549
+
550
+ #if !defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER )
549
551
uint32_t subevent_us ;
550
552
uint32_t start_us ;
551
553
@@ -555,6 +557,7 @@ static void isr_tx(void *param)
555
557
556
558
start_us = radio_tmr_start_us (1U , subevent_us );
557
559
LL_ASSERT (start_us == (subevent_us + 1U ));
560
+ #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
558
561
559
562
/* Get reference to ACL context */
560
563
evt_conn_lll = ull_conn_lll_get (cis_lll -> acl_handle );
@@ -574,9 +577,7 @@ static void isr_tx(void *param)
574
577
uint64_t payload_count ;
575
578
uint16_t event_counter ;
576
579
uint16_t data_chan_id ;
577
- uint32_t subevent_us ;
578
580
uint16_t cis_handle ;
579
- uint32_t start_us ;
580
581
memq_link_t * link ;
581
582
582
583
/* Calculate channel for next CIS */
@@ -590,12 +591,23 @@ static void isr_tx(void *param)
590
591
return ;
591
592
}
592
593
593
- /* Get reference to ACL context */
594
- next_conn_lll = ull_conn_lll_get (next_cis_lll -> acl_handle );
594
+ #if !defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER )
595
+ uint32_t subevent_us ;
596
+ uint32_t start_us ;
597
+
598
+ subevent_us = radio_tmr_ready_restore ();
599
+ subevent_us += next_cis_lll -> offset - cis_offset_first ;
600
+
601
+ start_us = radio_tmr_start_us (1U , subevent_us );
602
+ LL_ASSERT (start_us == (subevent_us + 1U ));
603
+ #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
595
604
596
605
/* Event counter value, 0-15 bit of cisEventCounter */
597
606
event_counter = next_cis_lll -> event_count ;
598
607
608
+ /* Get reference to ACL context */
609
+ next_conn_lll = ull_conn_lll_get (next_cis_lll -> acl_handle );
610
+
599
611
/* Calculate the radio channel to use for ISO event */
600
612
data_chan_id = lll_chan_id (next_cis_lll -> access_addr );
601
613
next_cis_chan = lll_chan_iso_event (event_counter , data_chan_id ,
@@ -604,12 +616,6 @@ static void isr_tx(void *param)
604
616
& next_cis_chan_prn_s ,
605
617
& next_cis_chan_remap_idx );
606
618
607
- subevent_us = radio_tmr_ready_restore ();
608
- subevent_us += next_cis_lll -> offset - cis_offset_first ;
609
-
610
- start_us = radio_tmr_start_us (1U , subevent_us );
611
- LL_ASSERT (start_us == (subevent_us + 1U ));
612
-
613
619
cis_lll = next_cis_lll ;
614
620
615
621
/* Tx Ack stale ISO Data */
@@ -838,9 +844,18 @@ static void isr_rx(void *param)
838
844
uint64_t payload_count ;
839
845
uint16_t event_counter ;
840
846
uint16_t data_chan_id ;
847
+ memq_link_t * link ;
848
+
849
+ #if !defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER )
841
850
uint32_t subevent_us ;
842
851
uint32_t start_us ;
843
- memq_link_t * link ;
852
+
853
+ subevent_us = radio_tmr_ready_restore ();
854
+ subevent_us += next_cis_lll -> offset - cis_offset_first ;
855
+
856
+ start_us = radio_tmr_start_us (1U , subevent_us );
857
+ LL_ASSERT (start_us == (subevent_us + 1U ));
858
+ #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
844
859
845
860
/* Event counter value, 0-15 bit of cisEventCounter */
846
861
event_counter = next_cis_lll -> event_count ;
@@ -853,12 +868,6 @@ static void isr_rx(void *param)
853
868
& next_cis_chan_prn_s ,
854
869
& next_cis_chan_remap_idx );
855
870
856
- subevent_us = radio_tmr_ready_restore ();
857
- subevent_us += next_cis_lll -> offset - cis_offset_first ;
858
-
859
- start_us = radio_tmr_start_us (1U , subevent_us );
860
- LL_ASSERT (start_us == (subevent_us + 1U ));
861
-
862
871
old_cis_lll = cis_lll ;
863
872
cis_lll = next_cis_lll ;
864
873
@@ -935,7 +944,6 @@ static void isr_prepare_subevent(void *param)
935
944
struct pdu_cis * pdu_tx ;
936
945
uint64_t payload_count ;
937
946
uint8_t payload_index ;
938
- uint32_t subevent_us ;
939
947
uint32_t start_us ;
940
948
941
949
/* Get reference to CIS LLL context */
@@ -1052,12 +1060,26 @@ static void isr_prepare_subevent(void *param)
1052
1060
radio_switch_complete_and_rx (0U );
1053
1061
#endif /* !CONFIG_BT_CTLR_PHY */
1054
1062
1063
+ #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN ) || \
1064
+ defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER )
1065
+ uint32_t subevent_us ;
1066
+
1055
1067
subevent_us = radio_tmr_ready_restore ();
1056
1068
subevent_us += cis_lll -> offset - cis_offset_first +
1057
1069
(cis_lll -> sub_interval * se_curr );
1058
1070
1071
+ #if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER )
1072
+ start_us = radio_tmr_start_us (1U , subevent_us );
1073
+ LL_ASSERT (start_us == (subevent_us + 1U ));
1074
+
1075
+ #else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
1059
1076
/* Compensate for the 1 us added by radio_tmr_start_us() */
1060
1077
start_us = subevent_us + 1U ;
1078
+ #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
1079
+
1080
+ #endif /* HAL_RADIO_GPIO_HAVE_PA_PIN ||
1081
+ * CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER
1082
+ */
1061
1083
1062
1084
/* capture end of Tx-ed PDU, used to calculate HCTO. */
1063
1085
radio_tmr_end_capture ();
0 commit comments