adding some error checks on trx_read
This commit is contained in:
+12
-11
@@ -337,7 +337,7 @@ static void *UE_thread_synch(void *arg) {
|
|||||||
if ( threads.iq != -1 )
|
if ( threads.iq != -1 )
|
||||||
CPU_SET(threads.iq, &cpuset);
|
CPU_SET(threads.iq, &cpuset);
|
||||||
// this thread priority must be lower that the main acquisition thread
|
// this thread priority must be lower that the main acquisition thread
|
||||||
sprintf(threadname, "sync UE %d\n", UE->Mod_id);
|
sprintf(threadname, "sync UE %d", UE->Mod_id);
|
||||||
init_thread(100000, 500000, FIFO_PRIORITY-1, &cpuset, threadname);
|
init_thread(100000, 500000, FIFO_PRIORITY-1, &cpuset, threadname);
|
||||||
|
|
||||||
UE->is_synchronized = 0;
|
UE->is_synchronized = 0;
|
||||||
@@ -840,10 +840,10 @@ void *UE_thread(void *arg) {
|
|||||||
|
|
||||||
if (is_synchronized == 0) {
|
if (is_synchronized == 0) {
|
||||||
#if BASIC_SIMULATOR
|
#if BASIC_SIMULATOR
|
||||||
while (!((instance_cnt_synch = UE->proc.instance_cnt_synch) < 0)) {
|
while (!((instance_cnt_synch = UE->proc.instance_cnt_synch) < 0)) {
|
||||||
printf("ue sync not ready\n");
|
printf("ue sync not ready\n");
|
||||||
usleep(500*1000);
|
usleep(500*1000);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (instance_cnt_synch < 0) { // we can invoke the synch
|
if (instance_cnt_synch < 0) { // we can invoke the synch
|
||||||
// grab 10 ms of signal and wakeup synch thread
|
// grab 10 ms of signal and wakeup synch thread
|
||||||
@@ -856,7 +856,7 @@ void *UE_thread(void *arg) {
|
|||||||
×tamp,
|
×tamp,
|
||||||
rxp,
|
rxp,
|
||||||
UE->frame_parms.samples_per_subframe*10,
|
UE->frame_parms.samples_per_subframe*10,
|
||||||
UE->frame_parms.nb_antennas_rx), "");
|
UE->frame_parms.nb_antennas_rx), "error reading samples");
|
||||||
|
|
||||||
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
|
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
|
||||||
instance_cnt_synch = ++UE->proc.instance_cnt_synch;
|
instance_cnt_synch = ++UE->proc.instance_cnt_synch;
|
||||||
@@ -878,11 +878,12 @@ void *UE_thread(void *arg) {
|
|||||||
rxp[i] = (void*)&dummy_rx[i][0];
|
rxp[i] = (void*)&dummy_rx[i][0];
|
||||||
for (int sf=0; sf<LTE_NUMBER_OF_SUBFRAMES_PER_FRAME; sf++)
|
for (int sf=0; sf<LTE_NUMBER_OF_SUBFRAMES_PER_FRAME; sf++)
|
||||||
// printf("Reading dummy sf %d\n",sf);
|
// printf("Reading dummy sf %d\n",sf);
|
||||||
UE->rfdevice.trx_read_func(&UE->rfdevice,
|
AssertFatal(UE->frame_parms.samples_per_subframe==
|
||||||
×tamp,
|
UE->rfdevice.trx_read_func(&UE->rfdevice,
|
||||||
rxp,
|
×tamp,
|
||||||
UE->frame_parms.samples_per_subframe,
|
rxp,
|
||||||
UE->frame_parms.nb_antennas_rx);
|
UE->frame_parms.samples_per_subframe,
|
||||||
|
UE->frame_parms.nb_antennas_rx), "error reading samples");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user