fixes an issue with clock source
- command line paramter --clock-source can only be set at UE (removed this option from gNB) - at gNB use clock_source from RU section in config file - in both cases if clock_source is present in usrp_args, it will override clock_source
This commit is contained in:
@@ -135,6 +135,8 @@ typedef struct {
|
||||
|
||||
/*! \brief Clock source types */
|
||||
typedef enum {
|
||||
//! this means the paramter has not been set
|
||||
unset=-1,
|
||||
//! This tells the underlying hardware to use the internal reference
|
||||
internal=0,
|
||||
//! This tells the underlying hardware to use the external reference
|
||||
|
||||
@@ -1145,27 +1145,34 @@ extern "C" {
|
||||
device->priv = s;
|
||||
|
||||
if (args.find("clock_source")==std::string::npos) {
|
||||
LOG_I(HW, "Using clock_source == '%d'\n", openair0_cfg[0].clock_source);
|
||||
|
||||
if (openair0_cfg[0].clock_source == internal) {
|
||||
//in UHD 3.14 we could use
|
||||
//s->usrp->set_sync_source("clock_source=internal","time_source=internal");
|
||||
s->usrp->set_time_source("internal");
|
||||
s->usrp->set_clock_source("internal");
|
||||
LOG_D(HW,"Setting time and clock source to internal\n");
|
||||
}
|
||||
else if (openair0_cfg[0].clock_source == external ) {
|
||||
//s->usrp->set_sync_source("clock_source=external","time_source=external");
|
||||
s->usrp->set_time_source("external");
|
||||
s->usrp->set_clock_source("external");
|
||||
LOG_D(HW,"Setting time and clock source to external\n");
|
||||
}
|
||||
else if (openair0_cfg[0].clock_source==gpsdo) {
|
||||
s->usrp->set_clock_source("gpsdo");
|
||||
s->usrp->set_time_source("gpsdo");
|
||||
LOG_D(HW,"Setting time and clock source to gpsdo\n");
|
||||
}
|
||||
else {
|
||||
LOG_W(HW,"Clock source set neither in usrp_args nor on command line, using default!\n");
|
||||
}
|
||||
} else {
|
||||
LOG_W(HW, "clock_source already specified in device arguments! Ignoring command line parameter\n");
|
||||
}
|
||||
|
||||
else {
|
||||
if (openair0_cfg[0].clock_source != unset) {
|
||||
LOG_W(HW,"Clock source set in both usrp_args and in clock_source, ingnoring the latter!\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (s->usrp->get_clock_source(0) == "gpsdo") {
|
||||
s->use_gps = 1;
|
||||
if (sync_to_gps(device)==EXIT_SUCCESS) {
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \
|
||||
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
|
||||
{"clock", CONFIG_HLP_CLK, 0, uptr:&clock_source, defintval:0, TYPE_UINT, 0}, \
|
||||
{"clock-source", CONFIG_HLP_CLK, 0, iptr:&clock_source, defintval:0, TYPE_INT, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"A", CONFIG_HLP_TADV, 0, iptr:&(timingadv), defintval:0, TYPE_INT, 0} \
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user