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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user