diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-06 15:44:15 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-06 15:44:15 -0700 |
commit | 1ca30a49030da2ef248048e17a46738bb3823c4c (patch) | |
tree | c8d6764085f562862b0e166bb05f91f8f9ce06d4 /host/lib/usrp | |
parent | 189c4c96fc0b40aa98c28f6bd4b95753bdaec970 (diff) | |
download | uhd-1ca30a49030da2ef248048e17a46738bb3823c4c.tar.gz uhd-1ca30a49030da2ef248048e17a46738bb3823c4c.tar.bz2 uhd-1ca30a49030da2ef248048e17a46738bb3823c4c.zip |
uhd: added set time w/ unknown pps to mimo usrp, get tx rate bug fix
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/mimo_usrp.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/host/lib/usrp/mimo_usrp.cpp b/host/lib/usrp/mimo_usrp.cpp index 440aaf9f6..f5441e19d 100644 --- a/host/lib/usrp/mimo_usrp.cpp +++ b/host/lib/usrp/mimo_usrp.cpp @@ -27,6 +27,7 @@ #include <boost/foreach.hpp> #include <boost/format.hpp> #include <stdexcept> +#include <iostream> using namespace uhd; using namespace uhd::usrp; @@ -121,6 +122,22 @@ public: } } + void set_time_unknown_pps(const time_spec_t &time_spec){ + std::cout << "Set time with unknown pps edge:" << std::endl; + std::cout << " 1) set times next pps (race condition)" << std::endl; + set_time_next_pps(time_spec); sleep(1); + + std::cout << " 2) catch seconds rollover at pps edge" << std::endl; + time_t last_secs = 0, curr_secs = 0; + while(curr_secs == last_secs){ + last_secs = curr_secs; + curr_secs = get_time_now().get_full_secs(); + } + + std::cout << " 3) set times next pps (synchronously)" << std::endl; + set_time_next_pps(time_spec); sleep(1); + } + void issue_stream_cmd(const stream_cmd_t &stream_cmd){ BOOST_FOREACH(wax::obj mboard, _mboards){ mboard[MBOARD_PROP_STREAM_CMD] = stream_cmd; @@ -206,7 +223,7 @@ public: } double get_tx_rate_all(void){ - return _rx_rate; + return _tx_rate; } tune_result_t set_tx_freq(size_t chan, double target_freq){ |