diff options
Diffstat (limited to 'src/output/USRPTime.cpp')
-rw-r--r-- | src/output/USRPTime.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/output/USRPTime.cpp b/src/output/USRPTime.cpp index 59fa6b5..935d56b 100644 --- a/src/output/USRPTime.cpp +++ b/src/output/USRPTime.cpp @@ -88,9 +88,22 @@ USRPTime::USRPTime( m_conf(conf), time_last_check(timepoint_t::clock::now()) { - if (m_conf.enableSync and (m_conf.pps_src == "none")) { + if (m_conf.pps_src == "none") { + if (m_conf.enableSync) { + etiLog.level(warn) << + "OutputUHD: WARNING:" + " you are using synchronous transmission without PPS input!"; + } + set_usrp_time_from_localtime(); } + else if (m_conf.pps_src == "pps" or m_conf.pps_src == "gpsdo") { + set_usrp_time_from_pps(); + } + else { + throw std::runtime_error("USRPTime not implemented yet: " + + m_conf.pps_src); + } } bool USRPTime::verify_time() @@ -229,10 +242,6 @@ static uhd::time_spec_t uhd_timespec_now(void) void USRPTime::set_usrp_time_from_localtime() { - etiLog.level(warn) << - "OutputUHD: WARNING:" - " you are using synchronous transmission without PPS input!"; - const auto t = uhd_timespec_now(); m_usrp->set_time_now(t); |