From 0d1c88f1168506b082984445c9d1be2d1f4ac4f3 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 18 Jan 2018 08:27:47 +0100 Subject: Initialise USRP time also with pps --- src/output/USRPTime.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/output') 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); -- cgit v1.2.3