From b35de4c81e3044b440758e94efc205ec3a712a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rymanowski?= Date: Fri, 2 Mar 2018 11:48:58 +0100 Subject: [PATCH] nimble/dtm: Allow for being late on RX start timer So far we assert when being late or starting RX timer. Now we allow to be late as it is not important for dtm code. RX is still on after it. X-Original-Commit: dc600a051f11e3c9f31e93fdd45e63c659c3c8c4 --- nimble/controller/src/ble_ll_dtm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nimble/controller/src/ble_ll_dtm.c b/nimble/controller/src/ble_ll_dtm.c index 23a5cfcb2..e014d249e 100644 --- a/nimble/controller/src/ble_ll_dtm.c +++ b/nimble/controller/src/ble_ll_dtm.c @@ -311,7 +311,9 @@ ble_ll_dtm_rx_start(void) rc = ble_phy_setchan(channel_rf_to_index[g_ble_ll_dtm_ctx.rf_channel], BLE_DTM_SYNC_WORD, BLE_DTM_CRC); - assert(rc == 0); + if (rc) { + return rc; + } #if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_2M_PHY) || MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_CODED_PHY)) ble_phy_mode_set(g_ble_ll_dtm_ctx.phy_mode, g_ble_ll_dtm_ctx.phy_mode); @@ -319,7 +321,9 @@ ble_ll_dtm_rx_start(void) rc = ble_phy_rx_set_start_time(os_cputime_get32() + g_ble_ll_sched_offset_ticks, 0); - assert(rc == 0); + if (rc && rc != BLE_PHY_ERR_RX_LATE) { + return rc; + } ble_ll_state_set(BLE_LL_STATE_DTM);