From 056e3793477a6ed14520380ec179967565adcfc5 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Fri, 16 Feb 2018 16:09:07 +0100 Subject: [PATCH] Set TA to time_adv instead of nsamples --- srsue/src/phy/phch_recv.cc | 9 ++------- srsue/src/phy/phy.cc | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/srsue/src/phy/phch_recv.cc b/srsue/src/phy/phch_recv.cc index 80c972266..bda9fbd69 100644 --- a/srsue/src/phy/phch_recv.cc +++ b/srsue/src/phy/phch_recv.cc @@ -186,14 +186,9 @@ void phch_recv::set_agc_enable(bool enable) } } -void phch_recv::set_time_adv_sec(float _time_adv_sec) +void phch_recv::set_time_adv_sec(float time_adv_sec) { - if (TX_MODE_CONTINUOUS && !radio_h->is_first_of_burst()) { - int nsamples = ceil(current_srate*_time_adv_sec); - next_offset = -nsamples; - } else { - time_adv_sec = _time_adv_sec; - } + this->time_adv_sec = time_adv_sec; } void phch_recv::set_ue_sync_opts(srslte_ue_sync_t *q, float cfo) diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index 07337b022..84cd0fd08 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -226,7 +226,7 @@ void phy::set_timeadv_rar(uint32_t ta_cmd) { void phy::set_timeadv(uint32_t ta_cmd) { uint32_t new_nta = srslte_N_ta_new(n_ta, ta_cmd); - sf_recv.set_time_adv_sec(((float) (new_nta - n_ta))*SRSLTE_LTE_TS); + sf_recv.set_time_adv_sec(((float) new_nta)*SRSLTE_LTE_TS); Info("PHY: Set TA: ta_cmd: %d, n_ta: %d, old_n_ta: %d, ta_usec: %.1f\n", ta_cmd, new_nta, n_ta, ((float) new_nta)*SRSLTE_LTE_TS*1e6); n_ta = new_nta; }