Commit ba5e3e74 authored by Younes's avatar Younes

clock source / timing source split.

MTU tuning removed for now.
parent 22638ba0
...@@ -199,6 +199,8 @@ typedef struct { ...@@ -199,6 +199,8 @@ typedef struct {
double tx_bw; double tx_bw;
//! clock source //! clock source
clock_source_t clock_source; clock_source_t clock_source;
//! timing_source
clock_source_t timing_source;
//! Auto calibration flag //! Auto calibration flag
int autocal[4]; int autocal[4];
//! rf devices work with x bits iqs when oai have its own iq format //! rf devices work with x bits iqs when oai have its own iq format
......
...@@ -116,7 +116,7 @@ int trx_eth_start(openair0_device *device) { ...@@ -116,7 +116,7 @@ int trx_eth_start(openair0_device *device) {
*/ */
/* adjust MTU wrt number of samples per packet */ /* adjust MTU wrt number of samples per packet */
if(ethernet_tune (device,MTU_SIZE,UDP_IF4p5_PRACH_SIZE_BYTES)!=0) return -1; //if(ethernet_tune (device,MTU_SIZE,UDP_IF4p5_PRACH_SIZE_BYTES)!=0) return -1;
......
...@@ -1004,6 +1004,15 @@ extern "C" { ...@@ -1004,6 +1004,15 @@ extern "C" {
else else
s->usrp->set_clock_source("external"); s->usrp->set_clock_source("external");
if (openair0_cfg[0].time_source == internal){
LOG_I(PHY,"Setting time source to internal\n");
s->usrp->set_time_source("internal");
}
else{
LOG_I(PHY,"Setting time source to external\n");
s->usrp->set_time_source("external");
}
//Setting device type to USRP X300/X310 //Setting device type to USRP X300/X310
device->type=USRP_X300_DEV; device->type=USRP_X300_DEV;
...@@ -1062,12 +1071,22 @@ extern "C" { ...@@ -1062,12 +1071,22 @@ extern "C" {
// lock mboard clocks // lock mboard clocks
if (openair0_cfg[0].clock_source == internal){ if (openair0_cfg[0].clock_source == internal){
LOG_I(PHY,"Setting clock source to internal\n");
s->usrp->set_clock_source("internal"); s->usrp->set_clock_source("internal");
} }
else{ else{
LOG_I(PHY,"Setting clock source to external\n");
s->usrp->set_clock_source("external"); s->usrp->set_clock_source("external");
s->usrp->set_time_source("external");
} }
if (openair0_cfg[0].time_source == internal){
LOG_I(PHY,"Setting time source to internal\n");
s->usrp->set_time_source("internal");
}
else{
LOG_I(PHY,"Setting time source to external\n");
s->usrp->set_time_source("external");
}
device->type = USRP_B200_DEV; device->type = USRP_B200_DEV;
if ((vers == 3) && (subvers == 9) && (subsubvers>=2)) { if ((vers == 3) && (subvers == 9) && (subsubvers>=2)) {
......
...@@ -1880,7 +1880,7 @@ void *ru_thread_synch(void *arg) { ...@@ -1880,7 +1880,7 @@ void *ru_thread_synch(void *arg) {
ru->state = RU_RUN; ru->state = RU_RUN;
} // symc_pos > 0 } // symc_pos > 0
else { else {
if (cnt>50) { if (cnt>1000) {
write_output("ru_sync.m","sync",(void*)&sync_corr[0],fp->samples_per_tti*5,1,2); write_output("ru_sync.m","sync",(void*)&sync_corr[0],fp->samples_per_tti*5,1,2);
write_output("ru_rx.m","rxs",(void*)ru->common.rxdata[0],fp->samples_per_tti*10,1,1); write_output("ru_rx.m","rxs",(void*)ru->common.rxdata[0],fp->samples_per_tti*10,1,1);
exit(1); exit(1);
......
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