summaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-18 08:27:47 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-18 08:27:47 +0100
commit0d1c88f1168506b082984445c9d1be2d1f4ac4f3 (patch)
treed9362b11ae52d358d68653223a13d8d03969aaa6 /src/output
parentaa86ad4ce12cb4db89dd0d080bd6fcaed7c2d5b9 (diff)
downloaddabmod-0d1c88f1168506b082984445c9d1be2d1f4ac4f3.tar.gz
dabmod-0d1c88f1168506b082984445c9d1be2d1f4ac4f3.tar.bz2
dabmod-0d1c88f1168506b082984445c9d1be2d1f4ac4f3.zip
Initialise USRP time also with pps
Diffstat (limited to 'src/output')
-rw-r--r--src/output/USRPTime.cpp19
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);