Skip to content

Commit 0951a42

Browse files
committed
Bluetooth: Controller: Fix ISR profiling for single timer use
Fix ISR profiling when using single timer for tIFS radio switching wherein in the timer is cleared on every radio end. Hence, the captured timer value is the latency and does not required the radio end timestamp to be subtracted. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent b23e795 commit 0951a42

File tree

1 file changed

+4
-0
lines changed
  • subsys/bluetooth/controller/ll_sw/nordic/lll

1 file changed

+4
-0
lines changed

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_prof.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,15 @@ static uint16_t latency_get(void)
294294
/* calculate the elapsed time in us since on-air radio packet end
295295
* to ISR entry
296296
*/
297+
#if !defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
297298
#if defined(HAL_RADIO_GPIO_HAVE_PA_PIN)
298299
latency = timestamp_latency - timestamp_radio_end;
299300
#else /* !HAL_RADIO_GPIO_HAVE_PA_PIN */
300301
latency = timestamp_latency - radio_tmr_end_get();
301302
#endif /* !HAL_RADIO_GPIO_HAVE_PA_PIN */
303+
#else /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
304+
latency = timestamp_latency;
305+
#endif /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
302306

303307
return latency;
304308
}

0 commit comments

Comments
 (0)