diff options
| -rw-r--r-- | host/include/uhd/usrp/mimo_usrp.hpp | 18 | ||||
| -rw-r--r-- | host/lib/usrp/mimo_usrp.cpp | 19 | 
2 files changed, 36 insertions, 1 deletions
diff --git a/host/include/uhd/usrp/mimo_usrp.hpp b/host/include/uhd/usrp/mimo_usrp.hpp index e85c06046..68a42cad8 100644 --- a/host/include/uhd/usrp/mimo_usrp.hpp +++ b/host/include/uhd/usrp/mimo_usrp.hpp @@ -91,6 +91,24 @@ public:      virtual void set_time_next_pps(const time_spec_t &time_spec) = 0;      /*! +     * Synchronize the times across all motherboards in this configuration. +     * Use this method to sync the times when the edge of the PPS is unknown. +     * +     * Ex: Host machine is not attached to serial port of GPSDO +     * and can therefore not query the GPSDO for the PPS edge. +     * +     * This is a 3-step process, and will take at most 3 seconds to complete. +     * Upon completion, the times will be synchronized to the time provided. +     * +     * - Step1: set the time at the next pps (potential race condition) +     * - Step2: wait for the seconds to rollover to catch the pps edge +     * - Step3: set the time at the next pps (synchronous for all boards) +     * +     * \param time_spec the time to latch into the usrp device +     */ +    virtual void set_time_unknown_pps(const time_spec_t &time_spec) = 0; + +    /*!       * Issue a stream command to the usrp device.       * This tells the usrp to send samples into the host.       * See the documentation for stream_cmd_t for more info. 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){  | 
