aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-07-21 17:22:09 -0700
committerAshish Chaudhari <ashish@ettus.com>2015-07-22 11:26:36 -0700
commitdfedaf1726cd6ed1dbfc1c9d8c40716a557b05ed (patch)
tree4b512fb32d47d786bad5ab939eea9e759c21e85f /host
parenta12b24027fe1af9ca51949f6a9333ac5451690ef (diff)
downloaduhd-dfedaf1726cd6ed1dbfc1c9d8c40716a557b05ed.tar.gz
uhd-dfedaf1726cd6ed1dbfc1c9d8c40716a557b05ed.tar.bz2
uhd-dfedaf1726cd6ed1dbfc1c9d8c40716a557b05ed.zip
x300: Minor: Optimized ADC/DAC resets
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index c742d34df..aa38c8463 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -871,13 +871,11 @@ x300_impl::~x300_impl(void)
{
BOOST_FOREACH(mboard_members_t &mb, _mb)
{
- //disable/reset ADC/DAC
+ //Disable/reset ADC/DAC
mb.radio_perifs[0].misc_outs->set(radio_misc_outs_reg::ADC_RESET, 1);
mb.radio_perifs[0].misc_outs->set(radio_misc_outs_reg::DAC_RESET_N, 0);
mb.radio_perifs[0].misc_outs->set(radio_misc_outs_reg::DAC_ENABLED, 0);
mb.radio_perifs[0].misc_outs->flush();
- mb.radio_perifs[1].misc_outs->set(radio_misc_outs_reg::ADC_RESET, 1);
- mb.radio_perifs[1].misc_outs->set(radio_misc_outs_reg::DAC_RESET_N, 0);
mb.radio_perifs[1].misc_outs->set(radio_misc_outs_reg::DAC_ENABLED, 0);
mb.radio_perifs[1].misc_outs->flush();
@@ -922,14 +920,16 @@ void x300_impl::setup_radio(const size_t mb_i, const std::string &slot_name, con
perif.misc_outs->initialize(*perif.ctrl, true);
perif.misc_ins->initialize(*perif.ctrl);
- //reset adc + dac
- perif.misc_outs->set(radio_misc_outs_reg::ADC_RESET, 1);
- perif.misc_outs->set(radio_misc_outs_reg::DAC_RESET_N, 0);
- perif.misc_outs->flush();
- perif.misc_outs->set(radio_misc_outs_reg::ADC_RESET, 0);
- perif.misc_outs->set(radio_misc_outs_reg::DAC_RESET_N, 1);
- perif.misc_outs->set(radio_misc_outs_reg::DAC_ENABLED, 1);
- perif.misc_outs->flush();
+ //Only Radio0 has the ADC/DAC reset bits. Those bits are reserved for Radio1
+ if (radio_index == 0) {
+ perif.misc_outs->set(radio_misc_outs_reg::ADC_RESET, 1);
+ perif.misc_outs->set(radio_misc_outs_reg::DAC_RESET_N, 0);
+ perif.misc_outs->flush();
+ perif.misc_outs->set(radio_misc_outs_reg::ADC_RESET, 0);
+ perif.misc_outs->set(radio_misc_outs_reg::DAC_RESET_N, 1);
+ perif.misc_outs->flush();
+ }
+ perif.misc_outs->write(radio_misc_outs_reg::DAC_ENABLED, 1);
this->register_loopback_self_test(perif.ctrl);