summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b100
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-01-28 16:08:17 -0800
committerJosh Blum <josh@joshknows.com>2012-01-31 14:56:31 -0800
commitaa95e53a91fa52b61b6796fcfc811251b20dcb73 (patch)
treed8bb9ae4c2493c2404affdc5b407352c51451c46 /host/lib/usrp/b100
parent8f25550d1a8ac634ee3873ae90a86d1e07dd5482 (diff)
downloaduhd-aa95e53a91fa52b61b6796fcfc811251b20dcb73.tar.gz
uhd-aa95e53a91fa52b61b6796fcfc811251b20dcb73.tar.bz2
uhd-aa95e53a91fa52b61b6796fcfc811251b20dcb73.zip
dsp rework: work on scaling and args parsing on RX and TX dsp
This simplified some copy pasta in the io_impl.cpp files, and adds a place for sc8 tx mode in the tx dsp core code.
Diffstat (limited to 'host/lib/usrp/b100')
-rw-r--r--host/lib/usrp/b100/io_impl.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/host/lib/usrp/b100/io_impl.cpp b/host/lib/usrp/b100/io_impl.cpp
index c98f71754..6e9e017aa 100644
--- a/host/lib/usrp/b100/io_impl.cpp
+++ b/host/lib/usrp/b100/io_impl.cpp
@@ -154,6 +154,8 @@ void b100_impl::update_tx_samp_rate(const size_t dspno, const double rate){
if (my_streamer.get() == NULL) return;
my_streamer->set_samp_rate(rate);
+ const double adj = _tx_dsp->get_scaling_adjustment();
+ my_streamer->set_scale_factor(adj);
}
void b100_impl::update_rx_subdev_spec(const uhd::usrp::subdev_spec_t &spec){
@@ -202,7 +204,6 @@ rx_streamer::sptr b100_impl::get_rx_stream(const uhd::stream_args_t &args_){
//setup defaults for unspecified values
args.otw_format = args.otw_format.empty()? "sc16" : args.otw_format;
args.channels = args.channels.empty()? std::vector<size_t>(1, 0) : args.channels;
- const unsigned sc8_scalar = unsigned(args.args.cast<double>("scalar", 1));
//calculate packet size
static const size_t hdr_size = 0
@@ -233,8 +234,7 @@ rx_streamer::sptr b100_impl::get_rx_stream(const uhd::stream_args_t &args_){
for (size_t chan_i = 0; chan_i < args.channels.size(); chan_i++){
const size_t dsp = args.channels[chan_i];
_rx_dsps[dsp]->set_nsamps_per_packet(spp); //seems to be a good place to set this
- if (not args.args.has_key("noclear")) _rx_dsps[dsp]->clear();
- _rx_dsps[dsp]->set_format(args.otw_format, sc8_scalar);
+ _rx_dsps[dsp]->setup(args);
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&recv_packet_demuxer::get_recv_buff, _io_impl->demuxer, dsp, _1
), true /*flush*/);
@@ -260,10 +260,6 @@ tx_streamer::sptr b100_impl::get_tx_stream(const uhd::stream_args_t &args_){
args.otw_format = args.otw_format.empty()? "sc16" : args.otw_format;
args.channels = args.channels.empty()? std::vector<size_t>(1, 0) : args.channels;
- if (args.otw_format != "sc16"){
- throw uhd::value_error("USRP TX cannot handle requested wire format: " + args.otw_format);
- }
-
//calculate packet size
static const size_t hdr_size = 0
+ vrt::max_if_hdr_words32*sizeof(boost::uint32_t)
@@ -291,8 +287,7 @@ tx_streamer::sptr b100_impl::get_tx_stream(const uhd::stream_args_t &args_){
for (size_t chan_i = 0; chan_i < args.channels.size(); chan_i++){
const size_t dsp = args.channels[chan_i];
UHD_ASSERT_THROW(dsp == 0); //always 0
- if (not args.args.has_key("noclear")) _tx_dsp->clear();
- if (args.args.has_key("underflow_policy")) _tx_dsp->set_underflow_policy(args.args["underflow_policy"]);
+ _tx_dsp->setup(args);
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&zero_copy_if::get_send_buff, _data_transport, _1
));