aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_regs.cpp
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-10-12 16:26:19 -0700
committerNick Foster <nick@nerdnetworks.org>2010-10-12 16:26:19 -0700
commit5b4cbfe4616492d96ad1b48578cf2d94e1216bf4 (patch)
tree67d843278ead59b2e85725b3dbc3de80562d9ccd /host/lib/usrp/usrp2/usrp2_regs.cpp
parent5982ec4ee2c6f9efca1c5068e42dc38b822df7dc (diff)
downloaduhd-5b4cbfe4616492d96ad1b48578cf2d94e1216bf4.tar.gz
uhd-5b4cbfe4616492d96ad1b48578cf2d94e1216bf4.tar.bz2
uhd-5b4cbfe4616492d96ad1b48578cf2d94e1216bf4.zip
USRP2P: mboard rev works through props interface.
Added usrp2_burn_mb_rev.cpp to utils. It is not installed to the utils install dir. Not all happy with the mboard_rev setup -- is_usrp2p() is too specific for a generalized mboard_rev concept. I'm not sure where else to put it so for now it stays.
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_regs.cpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_regs.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_regs.cpp b/host/lib/usrp/usrp2/usrp2_regs.cpp
index 49f077221..f9b54b76e 100644
--- a/host/lib/usrp/usrp2/usrp2_regs.cpp
+++ b/host/lib/usrp/usrp2/usrp2_regs.cpp
@@ -15,19 +15,20 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
+#include <uhd/usrp/mboard_rev.hpp>
#include "usrp2_regs.hpp"
int sr_addr(int misc_output_base, int sr) {
return misc_output_base + 4 * sr;
}
-usrp2_regs_t usrp2_get_regs(int hw_rev) {
+usrp2_regs_t usrp2_get_regs(uhd::usrp::mboard_rev_t hw_rev) {
//how about you just make this dependent on hw_rev instead of doing the init before main, and give up the const globals, since the application won't ever need both.
- const int misc_output_base = (hw_rev>=USRP2P_FIRST_HW_REV) ? USRP2P_MISC_OUTPUT_BASE : USRP2_MISC_OUTPUT_BASE,
- gpio_base = (hw_rev>=USRP2P_FIRST_HW_REV) ? USRP2P_GPIO_BASE : USRP2_GPIO_BASE,
- atr_base = (hw_rev>=USRP2P_FIRST_HW_REV) ? USRP2P_ATR_BASE : USRP2_ATR_BASE,
- bp_base = (hw_rev>=USRP2P_FIRST_HW_REV) ? USRP2P_BP_STATUS_BASE : USRP2_BP_STATUS_BASE;
+ const int misc_output_base = (hw_rev.is_usrp2p()) ? USRP2P_MISC_OUTPUT_BASE : USRP2_MISC_OUTPUT_BASE,
+ gpio_base = (hw_rev.is_usrp2p()) ? USRP2P_GPIO_BASE : USRP2_GPIO_BASE,
+ atr_base = (hw_rev.is_usrp2p()) ? USRP2P_ATR_BASE : USRP2_ATR_BASE,
+ bp_base = (hw_rev.is_usrp2p()) ? USRP2P_BP_STATUS_BASE : USRP2_BP_STATUS_BASE;
usrp2_regs_t x;
x.sr_misc = 0;