summaryrefslogtreecommitdiff
path: root/gr-uhd/lib/usrp_block_impl.cc
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2017-10-05 16:09:55 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2017-10-05 16:36:29 -0700
commit3c63f7334d6de70d655aa97fcccbfb950645f4d4 (patch)
treeac06cdb228d00e02fcab9a47852bfc57b5957d0c /gr-uhd/lib/usrp_block_impl.cc
parent8fe518ce740ae728f658c1854a7ffa074e800e9d (diff)
parenta0adcd3347c7ffd6ef3c42ce7705a23978774d3b (diff)
Merge branch 'master' into next
Conflicts: gr-digital/examples/CMakeLists.txt gr-uhd/lib/usrp_source_impl.cc gr-uhd/lib/usrp_source_impl.h
Diffstat (limited to 'gr-uhd/lib/usrp_block_impl.cc')
-rw-r--r--gr-uhd/lib/usrp_block_impl.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/gr-uhd/lib/usrp_block_impl.cc b/gr-uhd/lib/usrp_block_impl.cc
index 341e1a9fd8..df1832ed2e 100644
--- a/gr-uhd/lib/usrp_block_impl.cc
+++ b/gr-uhd/lib/usrp_block_impl.cc
@@ -39,6 +39,7 @@ const pmt::pmt_t CMD_BANDWIDTH_KEY = pmt::mp("bandwidth");
const pmt::pmt_t CMD_TIME_KEY = pmt::mp("time");
const pmt::pmt_t CMD_MBOARD_KEY = pmt::mp("mboard");
const pmt::pmt_t CMD_ANTENNA_KEY = pmt::mp("antenna");
+const pmt::pmt_t CMD_DIRECTION_KEY = pmt::mp("direction");
/**********************************************************************
@@ -209,11 +210,11 @@ bool usrp_block_impl::_check_mboard_sensors_locked()
}
void
-usrp_block_impl::_set_center_freq_from_internals_allchans()
+usrp_block_impl::_set_center_freq_from_internals_allchans(pmt::pmt_t direction)
{
while (_chans_to_tune.any()) {
// This resets() bits, so this loop should not run indefinitely
- _set_center_freq_from_internals(_chans_to_tune.find_first());
+ _set_center_freq_from_internals(_chans_to_tune.find_first(), direction);
}
}
@@ -503,8 +504,14 @@ void usrp_block_impl::msg_handler_command(pmt::pmt_t msg)
}
}
- /// 4) Check if we need to re-tune
- _set_center_freq_from_internals_allchans();
+ /// 4) See if a direction was specified
+ pmt::pmt_t direction = pmt::dict_ref(
+ msg, CMD_DIRECTION_KEY,
+ pmt::PMT_NIL // Anything except "TX" or "RX will default to the messaged block direction"
+ );
+
+ /// 5) Check if we need to re-tune
+ _set_center_freq_from_internals_allchans(direction);
}
@@ -663,4 +670,3 @@ void usrp_block_impl::_cmd_handler_dspfreq(const pmt::pmt_t &dspfreq, int chan,
_update_curr_tune_req(new_tune_request, chan);
}
-