From ea085b5fc146b244f0f5cd75beff870638f51d31 Mon Sep 17 00:00:00 2001
From: Thomas Schlichter <thomas.schlichter@iis.fraunhofer.de>
Date: Mon, 25 Jul 2022 11:50:43 +0200
Subject: [PATCH] harmonize initialization of symbol- and timeshift-rotation

---
 executables/nr-uesoftmodem.c   | 2 --
 openair1/PHY/INIT/nr_init.c    | 4 ++++
 openair1/PHY/INIT/nr_init_ue.c | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c
index 92dab90014..8d689f7c00 100644
--- a/executables/nr-uesoftmodem.c
+++ b/executables/nr-uesoftmodem.c
@@ -518,8 +518,6 @@ int main( int argc, char **argv ) {
             *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]);
       }
 
-      init_symbol_rotation(&UE[CC_id]->frame_parms);
-      init_timeshift_rotation(&UE[CC_id]->frame_parms);
       init_nr_ue_vars(UE[CC_id], 0, abstraction_flag);
     }
 
diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c
index 6b984f53db..3088dbee5c 100644
--- a/openair1/PHY/INIT/nr_init.c
+++ b/openair1/PHY/INIT/nr_init.c
@@ -905,7 +905,11 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
   gNB_config->carrier_config.dl_bandwidth.value = config_bandwidth(mu, N_RB_DL, fp->nr_band);
 
   nr_init_frame_parms(gNB_config, fp);
+
   fp->ofdm_offset_divisor = UINT_MAX;
+  init_symbol_rotation(fp);
+  init_timeshift_rotation(fp);
+
   gNB->configured    = 1;
   LOG_I(PHY,"gNB configured\n");
 }
diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c
index e396651133..64bbed571c 100644
--- a/openair1/PHY/INIT/nr_init_ue.c
+++ b/openair1/PHY/INIT/nr_init_ue.c
@@ -376,6 +376,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
 
   init_nr_prach_tables(839);
   init_symbol_rotation(fp);
+  init_timeshift_rotation(fp);
+
   return 0;
 }
 
-- 
2.26.2