Revision a5ffda85 host/lib/usrp/usrp2/usrp2_impl.cpp
| b/host/lib/usrp/usrp2/usrp2_impl.cpp | ||
|---|---|---|
| 604 | 604 |
//setup reference source props |
| 605 | 605 |
_tree->create<std::string>(mb_path / "clock_source/value") |
| 606 | 606 |
.subscribe(boost::bind(&usrp2_impl::update_clock_source, this, mb, _1)); |
| 607 |
static const std::vector<std::string> clock_sources = boost::assign::list_of("internal")("external")("mimo");
|
|
| 607 |
std::vector<std::string> clock_sources = boost::assign::list_of("internal")("external")("mimo");
|
|
| 608 |
if (_mbc[mb].gps and _mbc[mb].gps->gps_detected()) clock_sources.push_back("gpsdo");
|
|
| 608 | 609 |
_tree->create<std::vector<std::string> >(mb_path / "clock_source/options").set(clock_sources); |
| 609 | 610 |
//plug timed commands into tree here |
| 610 | 611 |
switch(_mbc[mb].iface->get_rev()){
|
| ... | ... | |
| 690 | 691 |
_tree->access<std::string>(root / "time_source/value").set("none");
|
| 691 | 692 |
|
| 692 | 693 |
//GPS installed: use external ref, time, and init time spec |
| 693 |
if (_mbc[mb].gps.get() and _mbc[mb].gps->gps_detected()){
|
|
| 694 |
if (_mbc[mb].gps and _mbc[mb].gps->gps_detected()){
|
|
| 695 |
_mbc[mb].time64->enable_gpsdo(); |
|
| 694 | 696 |
UHD_MSG(status) << "Setting references to the internal GPSDO" << std::endl; |
| 695 |
_tree->access<std::string>(root / "time_source/value").set("external");
|
|
| 696 |
_tree->access<std::string>(root / "clock_source/value").set("external");
|
|
| 697 |
_tree->access<std::string>(root / "time_source/value").set("gpsdo");
|
|
| 698 |
_tree->access<std::string>(root / "clock_source/value").set("gpsdo");
|
|
| 697 | 699 |
UHD_MSG(status) << "Initializing time to the internal GPSDO" << std::endl; |
| 698 | 700 |
_mbc[mb].time64->set_time_next_pps(time_spec_t(time_t(_mbc[mb].gps->get_sensor("gps_time").to_int()+1)));
|
| 699 | 701 |
} |
| ... | ... | |
| 771 | 773 |
case usrp2_iface::USRP_N210_R4: |
| 772 | 774 |
if (source == "internal") _mbc[mb].iface->poke32(U2_REG_MISC_CTRL_CLOCK, 0x12); |
| 773 | 775 |
else if (source == "external") _mbc[mb].iface->poke32(U2_REG_MISC_CTRL_CLOCK, 0x1C); |
| 776 |
else if (source == "gpsdo") _mbc[mb].iface->poke32(U2_REG_MISC_CTRL_CLOCK, 0x1C); |
|
| 774 | 777 |
else if (source == "mimo") _mbc[mb].iface->poke32(U2_REG_MISC_CTRL_CLOCK, 0x15); |
| 775 | 778 |
else throw uhd::value_error("unhandled clock configuration reference source: " + source);
|
| 776 | 779 |
_mbc[mb].clock->enable_external_ref(true); //USRP2P has an internal 10MHz TCXO |
Also available in: Unified diff