diff options
| author | Ben Hilburn <ben.hilburn@ettus.com> | 2014-05-08 13:46:33 -0700 | 
|---|---|---|
| committer | Ben Hilburn <ben.hilburn@ettus.com> | 2014-05-08 13:46:33 -0700 | 
| commit | 0e51394db05b3e66ed5f7335eff363d658b3f47c (patch) | |
| tree | 166ab3c8c71b31beb6025037919f7dacdee3a23f | |
| parent | f8fbc2f2bc03b61cedc7bd20f4b7b59063a74bbf (diff) | |
| parent | 03e49fc9ab68e3a07a9fe1fb62fddfb94695c32a (diff) | |
| download | uhd-0e51394db05b3e66ed5f7335eff363d658b3f47c.tar.gz uhd-0e51394db05b3e66ed5f7335eff363d658b3f47c.tar.bz2 uhd-0e51394db05b3e66ed5f7335eff363d658b3f47c.zip  | |
Merge branch 'origin/martin/multi_usrp/bug_dc_offset' into maint
| -rw-r--r-- | host/lib/usrp/multi_usrp.cpp | 30 | 
1 files changed, 25 insertions, 5 deletions
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index 166b0cb37..71b1f8995 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -747,7 +747,11 @@ public:      void set_rx_dc_offset(const bool enb, size_t chan){          if (chan != ALL_CHANS){ -            _tree->access<bool>(rx_fe_root(chan) / "dc_offset" / "enable").set(enb); +            if (_tree->exists(rx_fe_root(chan) / "dc_offset" / "enable")) { +                _tree->access<bool>(rx_fe_root(chan) / "dc_offset" / "enable").set(enb); +            } else { +                UHD_MSG(warning) << "Setting DC offset compensation is not possible on this device." << std::endl; +            }              return;          }          for (size_t c = 0; c < get_rx_num_channels(); c++){ @@ -757,7 +761,11 @@ public:      void set_rx_dc_offset(const std::complex<double> &offset, size_t chan){          if (chan != ALL_CHANS){ -            _tree->access<std::complex<double> >(rx_fe_root(chan) / "dc_offset" / "value").set(offset); +            if (_tree->exists(rx_fe_root(chan) / "dc_offset" / "value")) { +                _tree->access<std::complex<double> >(rx_fe_root(chan) / "dc_offset" / "value").set(offset); +            } else { +                UHD_MSG(warning) << "Setting DC offset is not possible on this device." << std::endl; +            }              return;          }          for (size_t c = 0; c < get_rx_num_channels(); c++){ @@ -767,7 +775,11 @@ public:      void set_rx_iq_balance(const std::complex<double> &offset, size_t chan){          if (chan != ALL_CHANS){ -            _tree->access<std::complex<double> >(rx_fe_root(chan) / "iq_balance" / "value").set(offset); +            if (_tree->exists(rx_fe_root(chan) / "iq_balance" / "value")) { +                _tree->access<std::complex<double> >(rx_fe_root(chan) / "iq_balance" / "value").set(offset); +            } else { +                UHD_MSG(warning) << "Setting IQ balance is not possible on this device." << std::endl; +            }              return;          }          for (size_t c = 0; c < get_rx_num_channels(); c++){ @@ -933,7 +945,11 @@ public:      void set_tx_dc_offset(const std::complex<double> &offset, size_t chan){          if (chan != ALL_CHANS){ -            _tree->access<std::complex<double> >(tx_fe_root(chan) / "dc_offset" / "value").set(offset); +            if (_tree->exists(tx_fe_root(chan) / "dc_offset" / "value")) { +                _tree->access<std::complex<double> >(tx_fe_root(chan) / "dc_offset" / "value").set(offset); +            } else { +                UHD_MSG(warning) << "Setting DC offset is not possible on this device." << std::endl; +            }              return;          }          for (size_t c = 0; c < get_tx_num_channels(); c++){ @@ -943,7 +959,11 @@ public:      void set_tx_iq_balance(const std::complex<double> &offset, size_t chan){          if (chan != ALL_CHANS){ -            _tree->access<std::complex<double> >(tx_fe_root(chan) / "iq_balance" / "value").set(offset); +            if (_tree->exists(tx_fe_root(chan) / "iq_balance" / "value")) { +                _tree->access<std::complex<double> >(tx_fe_root(chan) / "iq_balance" / "value").set(offset); +            } else { +                UHD_MSG(warning) << "Setting IQ balance is not possible on this device." << std::endl; +            }              return;          }          for (size_t c = 0; c < get_tx_num_channels(); c++){  | 
