diff --git a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c index 385e9cba8c298624a44b2ca03463618eb69c0200..1a9e780e1dd1740aae93803b777b4e700f746529 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c @@ -449,6 +449,15 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { if (ue->frame_parms.frame_type==FDD) { ue->N_TA_offset = 0; } + else { + if (ue->frame_parms.N_RB_DL == 100) + ue->N_TA_offset = 624; + else if (ue->frame_parms.N_RB_DL == 50) + ue->N_TA_offset = 624/2; + else if (ue->frame_parms.N_RB_DL == 25) + ue->N_TA_offset = 624/4; + + } } LOG_I(PHY, "[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index e685811db79d067b6d66416eb9dc30c4df1ac917..8ab3f3979b6d5e544aa2dc18c5d80d223957d226 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1189,12 +1189,22 @@ void wakeup_L1s(RU_t *ru) { } inline int wakeup_prach_ru(RU_t *ru) { int ret; - struct timespec wait; + /*struct timespec wait; int time_ns = 5000000L; clock_gettime(CLOCK_REALTIME,&wait); wait.tv_nsec += time_ns; AssertFatal((ret=pthread_mutex_timedlock(&ru->proc.mutex_prach,&wait))==ETIMEDOUT,"[RU] ERROR pthread_mutex_lock for RU prach thread (IC %d)\n", ru->proc.instance_cnt_prach); +*/ + struct timespec wait; + wait.tv_sec=0; + wait.tv_nsec=5000000L; + + if (pthread_mutex_timedlock(&ru->proc.mutex_prach,&wait) !=0) { + LOG_E( PHY, "[RU] ERROR pthread_mutex_lock for RU prach thread (IC %d)\n", ru->proc.instance_cnt_prach); + exit_fun( "error locking mutex_rxtx" ); + return(-1); + } if (ru->proc.instance_cnt_prach==-1) { ++ru->proc.instance_cnt_prach;