From 1101fecc85a3b87928a7fcf8a5eff11d6716f84b Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Fri, 9 Sep 2022 12:08:45 +0200 Subject: [PATCH] nimble/ll: Fix txend callback We should call txend before transition as otherwise called code may mess up transition. --- nimble/drivers/nrf52/src/ble_phy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nimble/drivers/nrf52/src/ble_phy.c b/nimble/drivers/nrf52/src/ble_phy.c index eb55c2288..bfc111b6c 100644 --- a/nimble/drivers/nrf52/src/ble_phy.c +++ b/nimble/drivers/nrf52/src/ble_phy.c @@ -1025,6 +1025,10 @@ ble_phy_tx_end_isr(void) } #endif + if (g_ble_phy_data.txend_cb) { + g_ble_phy_data.txend_cb(g_ble_phy_data.txend_arg); + } + transition = g_ble_phy_data.phy_transition; if (transition == BLE_PHY_TRANSITION_TX_RX) { @@ -1081,10 +1085,6 @@ ble_phy_tx_end_isr(void) PPI_CHEN_CH20_Msk | PPI_CHEN_CH31_Msk); assert(transition == BLE_PHY_TRANSITION_NONE); } - - if (g_ble_phy_data.txend_cb) { - g_ble_phy_data.txend_cb(g_ble_phy_data.txend_arg); - } } static inline uint8_t