diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-11-15 22:27:56 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:06 -0800 |
commit | bc85ad9df0670e534fa73440c26609573ce1bc8f (patch) | |
tree | 97105f736966d58e8f700b9104a8c861121f46cf /host/lib/usrp/dboard/magnesium | |
parent | 96f209a56176d5c2fcda47e9a8f149862274f4e2 (diff) | |
download | uhd-bc85ad9df0670e534fa73440c26609573ce1bc8f.tar.gz uhd-bc85ad9df0670e534fa73440c26609573ce1bc8f.tar.bz2 uhd-bc85ad9df0670e534fa73440c26609573ce1bc8f.zip |
mg: Add stubs for lo_locked sensor
Diffstat (limited to 'host/lib/usrp/dboard/magnesium')
-rw-r--r-- | host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp index 5bbcacdf0..c35a15418 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp @@ -9,6 +9,7 @@ #include "spi_core_3000.hpp" #include <uhd/utils/log.hpp> #include <uhd/types/eeprom.hpp> +#include <uhd/types/sensors.hpp> #include <vector> #include <string> @@ -330,12 +331,27 @@ void magnesium_radio_ctrl_impl::_init_frontend_subtree( }) ; // FIXME separate DSA and Myk gains + // TX LO lock sensor + // Note: The lowband and AD9371 LO lock sensors are generated + // programmatically in set_rpc_client(). The actual lo_locked publisher is + // also set there. + subtree->create<sensor_value_t>(tx_fe_path / "sensors" / "lo_locked") + .set(sensor_value_t("all_los", false, "locked", "unlocked")) + .add_coerced_subscriber([](const sensor_value_t &){ + throw uhd::runtime_error( + "Attempting to write to sensor!"); + }) + ; + // RX LO lock sensor (see not on TX LO lock sensor) + subtree->create<sensor_value_t>(rx_fe_path / "sensors" / "lo_locked") + .set(sensor_value_t("all_los", false, "locked", "unlocked")) + ; } void magnesium_radio_ctrl_impl::_init_prop_tree() { const fs_path fe_base = fs_path("dboards") / _radio_slot; - this->_init_frontend_subtree(_tree->subtree(fe_base), 0); + this->_init_frontend_subtree(_tree->subtree(fe_base), 0); // TODO: When we go to one radio per dboard, the above if statement goes // away, and instead we have something like this: /* |