Commit 1a044242 authored by Raymond Knopp's avatar Raymond Knopp

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5503 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 2b352d6f
...@@ -1040,8 +1040,9 @@ static void *eNB_thread(void *arg) ...@@ -1040,8 +1040,9 @@ static void *eNB_thread(void *arg)
int ret; int ret;
// int tx_offset; // int tx_offset;
int sf; int sf;
#ifndef USRP
volatile unsigned int *DAQ_MBOX = openair0_daq_cnt(); volatile unsigned int *DAQ_MBOX = openair0_daq_cnt();
#endif
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
/* Wait for eNB application initialization to be complete (eNB registration to MME) */ /* Wait for eNB application initialization to be complete (eNB registration to MME) */
wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB); wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB);
...@@ -1071,6 +1072,8 @@ static void *eNB_thread(void *arg) ...@@ -1071,6 +1072,8 @@ static void *eNB_thread(void *arg)
timing_info.n_samples = 0; timing_info.n_samples = 0;
while (!oai_exit) { while (!oai_exit) {
#ifndef USRP
hw_slot = (((((volatile unsigned int *)DAQ_MBOX)[0]+1)%150)<<1)/15; hw_slot = (((((volatile unsigned int *)DAQ_MBOX)[0]+1)%150)<<1)/15;
// LOG_D(HW,"eNB frame %d, time %llu: slot %d, hw_slot %d (mbox %d)\n",frame,rt_get_time_ns(),slot,hw_slot,((unsigned int *)DAQ_MBOX)[0]); // LOG_D(HW,"eNB frame %d, time %llu: slot %d, hw_slot %d (mbox %d)\n",frame,rt_get_time_ns(),slot,hw_slot,((unsigned int *)DAQ_MBOX)[0]);
//this is the mbox counter where we should be //this is the mbox counter where we should be
...@@ -1132,6 +1135,26 @@ static void *eNB_thread(void *arg) ...@@ -1132,6 +1135,26 @@ static void *eNB_thread(void *arg)
diff = mbox_target - mbox_current; diff = mbox_target - mbox_current;
} }
#else // USRP
while (rx_cnt < sf_bounds[hw_subframe]) {
openair0.trx_read_func(&openair0, &timestamp, &rxdata[rx_cnt*samples_per_packets], samples_per_packets);
openair0.trx_write_func(&openair0, (timestamp+samples_per_packets*tx_delay-tx_forward_nsamps), &txdata[tx_cnt*samples_per_packets], samples_per_packets, 1);
rx_cnt++;
tx_cnt++;
}
#ifndef RTAI
//pthread_mutex_lock(&tti_mutex);
#endif
hw_subframe++;
slot+=2;
if(hw_subframe==10)
hw_subframe = 0;
#endif // USRP
if (oai_exit) break; if (oai_exit) break;
if (frame>5) { if (frame>5) {
...@@ -1206,8 +1229,14 @@ static void *eNB_thread(void *arg) ...@@ -1206,8 +1229,14 @@ static void *eNB_thread(void *arg)
} }
} }
} }
#ifndef USRP
slot++; slot++;
#else
if(rx_cnt == max_cnt) {
rx_cnt = 0;
}
#endif
if (slot==20) { if (slot==20) {
slot=0; slot=0;
frame++; frame++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment