aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-19 13:04:07 -0700
committerJosh Blum <josh@joshknows.com>2010-10-19 13:04:07 -0700
commit083413de3dc67e34042ec4e3e77b0ebfaf19009b (patch)
treea75ce4ed525a3812d9689417ff07450873c398ab /host
parent982ac435e99a7bb9de3838f5919643cfe5cb8851 (diff)
downloaduhd-083413de3dc67e34042ec4e3e77b0ebfaf19009b.tar.gz
uhd-083413de3dc67e34042ec4e3e77b0ebfaf19009b.tar.bz2
uhd-083413de3dc67e34042ec4e3e77b0ebfaf19009b.zip
multi-usrp: fixed num channel calculation, moved logic to cpm functions
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/multi_usrp.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp
index cb44bc468..6df3afbf8 100644
--- a/host/lib/usrp/multi_usrp.cpp
+++ b/host/lib/usrp/multi_usrp.cpp
@@ -190,13 +190,7 @@ public:
}
size_t get_rx_num_channels(void){
- size_t nchan = get_rx_subdev_spec(0).size();
- for (size_t m = 1; m < get_num_mboards(); m++){
- if (nchan != get_rx_subdev_spec(m).size()){
- throw std::runtime_error("rx subdev spec size inconsistent across all mboards");
- }
- }
- return nchan;
+ return rx_cpm()*get_num_mboards(); //total num channels
}
std::string get_rx_subdev_name(size_t chan){
@@ -296,13 +290,7 @@ public:
}
size_t get_tx_num_channels(void){
- size_t nchan = get_tx_subdev_spec(0).size();
- for (size_t m = 1; m < get_num_mboards(); m++){
- if (nchan != get_tx_subdev_spec(m).size()){
- throw std::runtime_error("tx subdev spec size inconsistent across all mboards");
- }
- }
- return nchan;
+ return tx_cpm()*get_num_mboards(); //total num channels
}
void set_tx_rate(double rate){
@@ -372,11 +360,23 @@ private:
device::sptr _dev;
size_t rx_cpm(void){ //channels per mboard
- return get_rx_num_channels()/get_num_mboards();
+ size_t nchan = get_rx_subdev_spec(0).size();
+ for (size_t m = 1; m < get_num_mboards(); m++){
+ if (nchan != get_rx_subdev_spec(m).size()){
+ throw std::runtime_error("rx subdev spec size inconsistent across all mboards");
+ }
+ }
+ return nchan;
}
size_t tx_cpm(void){ //channels per mboard
- return get_tx_num_channels()/get_num_mboards();
+ size_t nchan = get_tx_subdev_spec(0).size();
+ for (size_t m = 1; m < get_num_mboards(); m++){
+ if (nchan != get_tx_subdev_spec(m).size()){
+ throw std::runtime_error("tx subdev spec size inconsistent across all mboards");
+ }
+ }
+ return nchan;
}
wax::obj _mboard(size_t mboard){