diff options
author | jblum | 2009-02-17 02:33:08 +0000 |
---|---|---|
committer | jblum | 2009-02-17 02:33:08 +0000 |
commit | 19e3114defa259f7fd941d46a6f6002db6b8a0de (patch) | |
tree | 8232ad38954c7ecc331e4a73723f0aba1b5340cc /usrp/host | |
parent | 9106e20f757dd22c00c0cacc242a0388323ab33e (diff) | |
download | gnuradio-19e3114defa259f7fd941d46a6f6002db6b8a0de.tar.gz gnuradio-19e3114defa259f7fd941d46a6f6002db6b8a0de.tar.bz2 gnuradio-19e3114defa259f7fd941d46a6f6002db6b8a0de.zip |
kludge the legacy: usrp subdevice 2, the 3rd subdevice
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10448 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp/host')
-rw-r--r-- | usrp/host/lib/legacy/db_basic.cc | 2 | ||||
-rw-r--r-- | usrp/host/lib/legacy/db_boards.cc | 2 | ||||
-rw-r--r-- | usrp/host/lib/legacy/usrp_standard.cc | 30 |
3 files changed, 14 insertions, 20 deletions
diff --git a/usrp/host/lib/legacy/db_basic.cc b/usrp/host/lib/legacy/db_basic.cc index 9c37c438e..4bafc9396 100644 --- a/usrp/host/lib/legacy/db_basic.cc +++ b/usrp/host/lib/legacy/db_basic.cc @@ -197,7 +197,7 @@ db_basic_rx::is_quadrature() // This bit of info is useful when setting up the USRP Rx mux register. - return false; + return (d_subdev == 2); } diff --git a/usrp/host/lib/legacy/db_boards.cc b/usrp/host/lib/legacy/db_boards.cc index 1ba8b0e7f..2498f3c66 100644 --- a/usrp/host/lib/legacy/db_boards.cc +++ b/usrp/host/lib/legacy/db_boards.cc @@ -46,6 +46,7 @@ instantiate_dbs(int dbid, usrp_basic_sptr usrp, int which_side) case(USRP_DBID_BASIC_RX): db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 0))); db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 1))); + db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 2))); break; case(USRP_DBID_LF_TX): @@ -55,6 +56,7 @@ instantiate_dbs(int dbid, usrp_basic_sptr usrp, int which_side) case(USRP_DBID_LF_RX): db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 0))); db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 1))); + db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 2))); break; case(USRP_DBID_DBS_RX): diff --git a/usrp/host/lib/legacy/usrp_standard.cc b/usrp/host/lib/legacy/usrp_standard.cc index 2cc08a8fd..d2360cc6f 100644 --- a/usrp/host/lib/legacy/usrp_standard.cc +++ b/usrp/host/lib/legacy/usrp_standard.cc @@ -585,32 +585,24 @@ usrp_standard_rx::determine_rx_mux_value(const usrp_subdev_spec &ss) // classes for the selected side. std::vector<db_base_sptr> db = this->db(ss.side); - unsigned int subdev0_uses, subdev1_uses, uses; + unsigned int uses; // compute bitmasks of used A/D's - if(db[0]->is_quadrature()) - subdev0_uses = 0x3; // uses A/D 0 and 1 - else - subdev0_uses = 0x1; // uses A/D 0 only - - if(db.size() > 1) // more than 1 subdevice? - subdev1_uses = 0x2; // uses A/D 1 only - else - subdev1_uses = 0x0; // uses no A/D (doesn't exist) - - if(ss.subdev == 0) - uses = subdev0_uses; + if(db[ss.subdev]->is_quadrature()) + uses = 0x3; // uses A/D 0 and 1 + else if (ss.subdev == 0) + uses = 0x1; // uses A/D 0 only else if(ss.subdev == 1) - uses = subdev1_uses; + uses = 0x2; // uses A/D 1 only else - throw std::invalid_argument("subdev_spec"); - + uses = 0x0; // uses no A/D (doesn't exist) + if(uses == 0){ - throw std::runtime_error("Daughterboard doesn't have a subdevice 1"); + throw std::runtime_error("Determine RX Mux Error"); } - bool swap_iq = db[0]->i_and_q_swapped(); + bool swap_iq = db[ss.subdev]->i_and_q_swapped(); truth_table_element truth_table[8] = { // (side, uses, swap_iq) : mux_val @@ -959,7 +951,7 @@ usrp_standard_tx::determine_tx_mux_value(const usrp_subdev_spec &ss) std::vector<db_base_sptr> db = this->db(ss.side); - if(db[0]->i_and_q_swapped()) { + if(db[ss.subdev]->i_and_q_swapped()) { unsigned int mask[2] = {0x0089, 0x8900}; return mask[ss.side]; } |