From e128948a96f8587eb7e965ad462c61fc25b87536 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 17 Feb 2011 18:55:55 -0800 Subject: usrp: support for multiple dsps in props and implemented in usrp1 usrp1 previously had 1 rx and 1 tx dsp with multiple freq params, it now has N and M dsps each with one freq param. This is more consistent with the multi-dsp model. The hack here is to only apply stream commands and sample rate changes to dsp0. --- host/lib/usrp/multi_usrp.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'host/lib/usrp/multi_usrp.cpp') diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index 5130d3ae8..2e38a9ff8 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -193,7 +193,7 @@ public: _rx_dsp(chan)[DSP_PROP_STREAM_CMD] = stream_cmd; return; } - for (size_t c = 0; m < get_rx_num_channels(); m++){ + for (size_t c = 0; c < get_rx_num_channels(); c++){ issue_stream_cmd(stream_cmd, c); } } @@ -245,13 +245,13 @@ public: return _rx_subdev(chan)[SUBDEV_PROP_NAME].as(); } - void set_rx_rate(double rate){ + void set_rx_rate(double rate, size_t chan){ if (chan != ALL_CHANS){ _rx_dsp(chan)[DSP_PROP_HOST_RATE] = rate; do_samp_rate_warning_message(rate, get_rx_rate(chan), "RX"); return; } - for (size_t c = 0; m < get_rx_num_channels(); m++){ + for (size_t c = 0; c < get_rx_num_channels(); c++){ set_rx_rate(rate, c); } } @@ -261,13 +261,13 @@ public: } tune_result_t set_rx_freq(const tune_request_t &tune_request, size_t chan){ - tune_result_t r = tune_rx_subdev_and_dsp(_rx_subdev(chan), _rx_dsp(chan), chan%rx_cpm(), tune_request); + tune_result_t r = tune_rx_subdev_and_dsp(_rx_subdev(chan), _rx_dsp(chan), tune_request); do_tune_freq_warning_message(tune_request.target_freq, get_rx_freq(chan), "RX"); return r; } double get_rx_freq(size_t chan){ - return derive_freq_from_rx_subdev_and_dsp(_rx_subdev(chan), _rx_dsp(chan), chan%rx_cpm()); + return derive_freq_from_rx_subdev_and_dsp(_rx_subdev(chan), _rx_dsp(chan)); } freq_range_t get_rx_freq_range(size_t chan){ @@ -347,13 +347,13 @@ public: return tx_cpm()*get_num_mboards(); //total num channels } - void set_tx_rate(double rate){ + void set_tx_rate(double rate, size_t chan){ if (chan != ALL_CHANS){ _tx_dsp(chan)[DSP_PROP_HOST_RATE] = rate; do_samp_rate_warning_message(rate, get_tx_rate(chan), "TX"); return; } - for (size_t c = 0; m < get_tx_num_channels(); m++){ + for (size_t c = 0; c < get_tx_num_channels(); c++){ set_tx_rate(rate, c); } } @@ -363,13 +363,13 @@ public: } tune_result_t set_tx_freq(const tune_request_t &tune_request, size_t chan){ - tune_result_t r = tune_tx_subdev_and_dsp(_tx_subdev(chan), _tx_dsp(chan), chan%tx_cpm(), tune_request); + tune_result_t r = tune_tx_subdev_and_dsp(_tx_subdev(chan), _tx_dsp(chan), tune_request); do_tune_freq_warning_message(tune_request.target_freq, get_tx_freq(chan), "TX"); return r; } double get_tx_freq(size_t chan){ - return derive_freq_from_tx_subdev_and_dsp(_tx_subdev(chan), _tx_dsp(chan), chan%tx_cpm()); + return derive_freq_from_tx_subdev_and_dsp(_tx_subdev(chan), _tx_dsp(chan)); } freq_range_t get_tx_freq_range(size_t chan){ @@ -453,11 +453,11 @@ private: } wax::obj _rx_dsp(size_t chan){ prop_names_t dsp_names = _mboard(chan/rx_cpm())[MBOARD_PROP_RX_DSP_NAMES].as(); - return _mboard(chan/rx_cpm())[named_prop_t(MBOARD_PROP_RX_DSP, dsp_names.at(chan%rx_cpm())]; + return _mboard(chan/rx_cpm())[named_prop_t(MBOARD_PROP_RX_DSP, dsp_names.at(chan%rx_cpm()))]; } wax::obj _tx_dsp(size_t chan){ prop_names_t dsp_names = _mboard(chan/tx_cpm())[MBOARD_PROP_TX_DSP_NAMES].as(); - return _mboard(chan/tx_cpm())[named_prop_t(MBOARD_PROP_TX_DSP, dsp_names.at(chan%tx_cpm())]; + return _mboard(chan/tx_cpm())[named_prop_t(MBOARD_PROP_TX_DSP, dsp_names.at(chan%tx_cpm()))]; } wax::obj _rx_dboard(size_t chan){ std::string db_name = get_rx_subdev_spec(chan/rx_cpm()).at(chan%rx_cpm()).db_name; -- cgit v1.2.3