diff --git a/srsue/hdr/phy/lte/worker_pool.h b/srsue/hdr/phy/lte/worker_pool.h index b548cc10c..9a20ea532 100644 --- a/srsue/hdr/phy/lte/worker_pool.h +++ b/srsue/hdr/phy/lte/worker_pool.h @@ -56,7 +56,7 @@ public: * @param cc_idx CC index * @param phy_cfg Actual PHY configuration */ - void set_config_unlocked(uint32_t cc_idx, srsran::phy_cfg_t phy_cfg); + void set_config(uint32_t cc_idx, const srsran::phy_cfg_t& phy_cfg); }; } // namespace lte diff --git a/srsue/hdr/phy/sync.h b/srsue/hdr/phy/sync.h index 8dc055ae2..793abed94 100644 --- a/srsue/hdr/phy/sync.h +++ b/srsue/hdr/phy/sync.h @@ -268,10 +268,10 @@ private: float dl_freq = -1; float ul_freq = -1; - const static int MIN_TTI_JUMP = 1; // Time gap reported to stack after receiving subframe - const static int MAX_TTI_JUMP = 1000; // Maximum time gap tolerance in RF stream metadata - - const uint8_t SYNC_CC_IDX = 0; ///< From the sync POV, the CC idx is always the first + const static int MIN_TTI_JUMP = 1; ///< Time gap reported to stack after receiving subframe + const static int MAX_TTI_JUMP = 1000; ///< Maximum time gap tolerance in RF stream metadata + const uint8_t SYNC_CC_IDX = 0; ///< From the sync POV, the CC idx is always the first + const uint32_t TIMEOUT_TO_IDLE_MS = 2; ///< Timeout in milliseconds for transitioning to IDLE }; } // namespace srsue diff --git a/srsue/src/phy/lte/worker_pool.cc b/srsue/src/phy/lte/worker_pool.cc index 7ce8f8808..f65bc9b0a 100644 --- a/srsue/src/phy/lte/worker_pool.cc +++ b/srsue/src/phy/lte/worker_pool.cc @@ -95,7 +95,7 @@ void worker_pool::stop() pool.stop(); } -void worker_pool::set_config_unlocked(uint32_t cc_idx, srsran::phy_cfg_t phy_cfg) +void worker_pool::set_config(uint32_t cc_idx, const srsran::phy_cfg_t& phy_cfg) { // Protect CC index bounds if (cc_idx >= SRSRAN_MAX_CARRIERS) { diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index d034cdd5a..e8df18a33 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -448,7 +448,7 @@ bool phy::set_config(const srsran::phy_cfg_t& config_, uint32_t cc_idx) // Apply configurations asynchronously to avoid race conditions cmd_worker.add_cmd([this, config_, cc_idx]() { logger_phy.info("Setting new PHY configuration cc_idx=%d...", cc_idx); - lte_workers.set_config_unlocked(cc_idx, config_); + lte_workers.set_config(cc_idx, config_); // It is up to the PRACH component to detect whether the cell or the configuration have changed to reconfigure configure_prach_params(); diff --git a/srsue/src/phy/sync.cc b/srsue/src/phy/sync.cc index 567e27ea4..76a8649bb 100644 --- a/srsue/src/phy/sync.cc +++ b/srsue/src/phy/sync.cc @@ -220,8 +220,8 @@ rrc_interface_phy_lte::cell_search_ret_t sync::cell_search_start(phy_cell_t* fou rrc_proc_state = PROC_SEARCH_RUNNING; // Wait for SYNC thread to transition to IDLE (max. 2000ms) - if (not phy_state.wait_idle(2)) { - Error("SYNC: Can not search while not in IDLE"); + if (not phy_state.wait_idle(TIMEOUT_TO_IDLE_MS)) { + Error("SYNC: Error transitioning to IDLE. Cell search cannot start."); return ret; } @@ -795,7 +795,7 @@ void sync::set_ue_sync_opts(srsran_ue_sync_t* q, float cfo) bool sync::set_cell(float cfo) { // Wait for SYNC thread to transition to IDLE (max. 2000ms) - if (not phy_state.wait_idle(2)) { + if (not phy_state.wait_idle(TIMEOUT_TO_IDLE_MS)) { Error("SYNC: Can not change Cell while not in IDLE"); return false; }