diff options
| author | michael-west <michael.west@ettus.com> | 2015-10-07 13:10:01 -0700 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2015-12-10 14:21:49 -0800 | 
| commit | f90b62f3871fb701a8d9cb7c91c1a7f3421fced9 (patch) | |
| tree | 85d85ed9be444df4348e397bdaa707cfbb5d4597 /host/lib/usrp/b200/b200_impl.cpp | |
| parent | 21df150ec873f15c4e85f9564b56586e3fe2afcf (diff) | |
| download | uhd-f90b62f3871fb701a8d9cb7c91c1a7f3421fced9.tar.gz uhd-f90b62f3871fb701a8d9cb7c91c1a7f3421fced9.tar.bz2 uhd-f90b62f3871fb701a8d9cb7c91c1a7f3421fced9.zip | |
B210: Add VITA time synchronization on internal signal
Diffstat (limited to 'host/lib/usrp/b200/b200_impl.cpp')
| -rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 22 | 
1 files changed, 15 insertions, 7 deletions
| diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index ffce08567..a18e595a6 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -555,7 +555,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s          client_settings = boost::make_shared<b200_ad9361_client_t>();      }      _codec_ctrl = ad9361_ctrl::make_spi(client_settings, _spi_iface, AD9361_SLAVENO); -    +      ////////////////////////////////////////////////////////////////////      // create codec control objects      //////////////////////////////////////////////////////////////////// @@ -623,15 +623,15 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s      //register time now and pps onto available radio cores      _tree->create<time_spec_t>(mb_path / "time" / "now") -        .publish(boost::bind(&time_core_3000::get_time_now, _radio_perifs[0].time64)); +        .publish(boost::bind(&time_core_3000::get_time_now, _radio_perifs[0].time64)) +        .subscribe(boost::bind(&b200_impl::sync_times, this, _1)) +        .set(0.0);      _tree->create<time_spec_t>(mb_path / "time" / "pps")          .publish(boost::bind(&time_core_3000::get_time_last_pps, _radio_perifs[0].time64)); -    for (size_t i = 0; i < _radio_perifs.size(); i++) +    BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)      { -        _tree->access<time_spec_t>(mb_path / "time" / "now") -            .subscribe(boost::bind(&time_core_3000::set_time_now, _radio_perifs[i].time64, _1));          _tree->access<time_spec_t>(mb_path / "time" / "pps") -            .subscribe(boost::bind(&time_core_3000::set_time_next_pps, _radio_perifs[i].time64, _1)); +            .subscribe(boost::bind(&time_core_3000::set_time_next_pps, perif.time64, _1));      }      //setup time source props @@ -1074,11 +1074,19 @@ void b200_impl::update_time_source(const std::string &source)          throw uhd::key_error("update_time_source: unknown source: " + source);      if (_time_source != value)      { -        _local_ctrl->poke32(TOREG(SR_CORE_PPS_SEL), value); +        _local_ctrl->poke32(TOREG(SR_CORE_SYNC), value);          _time_source = value;      }  } +void b200_impl::sync_times(const uhd::time_spec_t& t) +{ +    BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs) +        perif.time64->set_time_sync(t); +    _local_ctrl->poke32(TOREG(SR_CORE_SYNC), 1 << 2 | boost::uint32_t(_time_source)); +    _local_ctrl->poke32(TOREG(SR_CORE_SYNC), _time_source); +} +  /***********************************************************************   * GPIO setup   **********************************************************************/ | 
