From 1843c9efbc0bafe0debca83f22ff40dc40847660 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Wed, 29 Jul 2020 18:13:51 +0200 Subject: [PATCH] SRSENB: PUCCH TA measurement only available with detected PUCCH --- lib/src/phy/enb/enb_ul.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/src/phy/enb/enb_ul.c b/lib/src/phy/enb/enb_ul.c index 27d8ca10c..61c8993ba 100644 --- a/lib/src/phy/enb/enb_ul.c +++ b/lib/src/phy/enb/enb_ul.c @@ -214,12 +214,6 @@ static int get_pucch(srslte_enb_ul_t* q, srslte_ul_sf_cfg_t* ul_sf, srslte_pucch return SRSLTE_ERROR; } - // Copy measurements - if (cfg->meas_ta_en) { - pucch_res.ta_valid = !(isnan(q->chest_res.ta_us) || isinf(q->chest_res.ta_us)); - pucch_res.ta_us = q->chest_res.ta_us; - } - ret = srslte_pucch_decode(&q->pucch, ul_sf, cfg, &q->chest_res, q->sf_symbols, &pucch_res); if (ret < SRSLTE_SUCCESS) { ERROR("Error decoding PUCCH\n"); @@ -235,6 +229,12 @@ static int get_pucch(srslte_enb_ul_t* q, srslte_ul_sf_cfg_t* ul_sf, srslte_pucch // Check correlation value, keep maximum if (i == 0 || pucch_res.correlation > res->correlation) { + // Copy measurements only if PUCCH was decoded succesfully + if (cfg->meas_ta_en) { + pucch_res.ta_valid = !(isnan(q->chest_res.ta_us) || isinf(q->chest_res.ta_us)); + pucch_res.ta_us = q->chest_res.ta_us; + } + *res = pucch_res; } }