diff options
author | Josh Blum <josh@joshknows.com> | 2010-11-11 17:40:01 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-11-11 17:40:01 -0800 |
commit | 476afe68f5c37a3e10a1208b0150732d7770a023 (patch) | |
tree | 73ea72533375d32ac35bcfff578ac0d774a89343 /host/lib/usrp/usrp2/usrp2_regs.cpp | |
parent | 478f8174601350ad0edd52bb985657037b181a2d (diff) | |
download | uhd-476afe68f5c37a3e10a1208b0150732d7770a023.tar.gz uhd-476afe68f5c37a3e10a1208b0150732d7770a023.tar.bz2 uhd-476afe68f5c37a3e10a1208b0150732d7770a023.zip |
usrp2: made enums for the rev types and implemented in code
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_regs.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_regs.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_regs.cpp b/host/lib/usrp/usrp2/usrp2_regs.cpp index 5853e91e5..b24082edb 100644 --- a/host/lib/usrp/usrp2/usrp2_regs.cpp +++ b/host/lib/usrp/usrp2/usrp2_regs.cpp @@ -16,17 +16,19 @@ // #include "usrp2_regs.hpp" +#include "usrp2_iface.hpp" int sr_addr(int misc_output_base, int sr) { return misc_output_base + 4 * sr; } -usrp2_regs_t usrp2_get_regs(boost::uint16_t hw_rev) { +usrp2_regs_t usrp2_get_regs(bool use_n2xx_map) { + //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 >= usrp2_rev_nums(N2XX)) ? USRP2P_MISC_OUTPUT_BASE : USRP2_MISC_OUTPUT_BASE, - gpio_base = (hw_rev >= usrp2_rev_nums(N2XX)) ? USRP2P_GPIO_BASE : USRP2_GPIO_BASE, - atr_base = (hw_rev >= usrp2_rev_nums(N2XX)) ? USRP2P_ATR_BASE : USRP2_ATR_BASE, - bp_base = (hw_rev >= usrp2_rev_nums(N2XX)) ? USRP2P_BP_STATUS_BASE : USRP2_BP_STATUS_BASE; + const int misc_output_base = (use_n2xx_map) ? USRP2P_MISC_OUTPUT_BASE : USRP2_MISC_OUTPUT_BASE, + gpio_base = (use_n2xx_map) ? USRP2P_GPIO_BASE : USRP2_GPIO_BASE, + atr_base = (use_n2xx_map) ? USRP2P_ATR_BASE : USRP2_ATR_BASE, + bp_base = (use_n2xx_map) ? USRP2P_BP_STATUS_BASE : USRP2_BP_STATUS_BASE; usrp2_regs_t x; x.sr_misc = 0; |