diff --git a/srsapps/ue/phy/src/phy.cc b/srsapps/ue/phy/src/phy.cc index 3406633ea..6a8ab0724 100644 --- a/srsapps/ue/phy/src/phy.cc +++ b/srsapps/ue/phy/src/phy.cc @@ -131,7 +131,6 @@ void phy::set_param(phy_params::phy_param_t param, int64_t value) { params_db.set_param((uint32_t) param, value); } - // FIXME: Add PRACH power control bool phy::send_prach(uint32_t preamble_idx) { return send_prach(preamble_idx, -1, 0); @@ -158,32 +157,8 @@ void phy::send_sr(bool enable) if (enable) { // Get sr_periodicity and sr_N_offset from table 10.1-5 uint32_t I_sr = params_db.get_param(phy_params::SR_CONFIG_INDEX); - if (I_sr < 5) { - sr_periodicity = 5; - sr_N_offset = I_sr; - } else if (I_sr < 15) { - sr_periodicity = 10; - sr_N_offset = I_sr-5; - } else if (I_sr < 35) { - sr_periodicity = 20; - sr_N_offset = I_sr-15; - } else if (I_sr < 75) { - sr_periodicity = 40; - sr_N_offset = I_sr-35; - } else if (I_sr < 155) { - sr_periodicity = 80; - sr_N_offset = I_sr-75; - } else if (I_sr < 157) { - sr_periodicity = 2; - sr_N_offset = I_sr-155; - } else if (I_sr == 157) { - sr_periodicity = 1; - sr_N_offset = I_sr-157; - } else { - Error("Invalid I_sr=%d\n", I_sr); - return; - } sr_n_pucch = params_db.get_param(phy_params::SR_PUCCH_RESINDEX); + srslte_ue_ul_sr_config(I_sr, &sr_periodicity, &sr_N_offset); Info("SR I_sr=%d, periodicity=%d, N_offset=%d, n_pucch=%d\n", I_sr, sr_periodicity, sr_N_offset, sr_n_pucch); sr_tx_tti = get_current_tti(); } diff --git a/srsapps/ue/phy/src/prach.cc b/srsapps/ue/phy/src/prach.cc index 820283e1b..17714cf85 100644 --- a/srsapps/ue/phy/src/prach.cc +++ b/srsapps/ue/phy/src/prach.cc @@ -109,25 +109,11 @@ bool prach::is_ready_to_send(uint32_t current_tti_) { if (initiated && preamble_idx >= 0 && preamble_idx < 64 && params_db != NULL) { // consider the number of subframes the transmission must be anticipated uint32_t current_tti = (current_tti_ + tx_advance_sf)%10240; - - // Get SFN and sf_idx from the PRACH configuration index uint32_t config_idx = (uint32_t) params_db->get_param(phy_params::PRACH_CONFIG_INDEX); - srslte_prach_sfn_t prach_sfn = srslte_prach_get_sfn(config_idx); - - if (prach_sfn == SRSLTE_PRACH_SFN_EVEN && ((current_tti/10)%2)==0 || - prach_sfn == SRSLTE_PRACH_SFN_ANY) - { - srslte_prach_sf_config_t sf_config; - srslte_prach_sf_config(config_idx, &sf_config); - for (int i=0;i