diff options
author | Josh Blum <josh@joshknows.com> | 2012-05-12 14:20:26 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2012-05-14 11:59:20 -0700 |
commit | c94963a43665809d0a75cebac6283cb7c88a6f5c (patch) | |
tree | d541427555fd5c2aa206321bca2e962cc5aa3644 /host/lib/usrp/mboard_eeprom.cpp | |
parent | db6ba7d474d248c753ceee47f33db51504a8fd74 (diff) | |
download | uhd-c94963a43665809d0a75cebac6283cb7c88a6f5c.tar.gz uhd-c94963a43665809d0a75cebac6283cb7c88a6f5c.tar.bz2 uhd-c94963a43665809d0a75cebac6283cb7c88a6f5c.zip |
usrp: mboard eeprom map use string as key
Diffstat (limited to 'host/lib/usrp/mboard_eeprom.cpp')
-rw-r--r-- | host/lib/usrp/mboard_eeprom.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/host/lib/usrp/mboard_eeprom.cpp b/host/lib/usrp/mboard_eeprom.cpp index 96a0d36ce..1f4abc27e 100644 --- a/host/lib/usrp/mboard_eeprom.cpp +++ b/host/lib/usrp/mboard_eeprom.cpp @@ -447,20 +447,16 @@ mboard_eeprom_t::mboard_eeprom_t(void){ /* NOP */ } -mboard_eeprom_t::mboard_eeprom_t(i2c_iface &iface, map_type map){ - switch(map){ - case MAP_N100: load_n100(*this, iface); break; - case MAP_B000: load_b000(*this, iface); break; - case MAP_B100: load_b100(*this, iface); break; - case MAP_E100: load_e100(*this, iface); break; - } +mboard_eeprom_t::mboard_eeprom_t(i2c_iface &iface, const std::string &which){ + if (which == "N100") load_n100(*this, iface); + if (which == "B000") load_b000(*this, iface); + if (which == "B100") load_b100(*this, iface); + if (which == "E100") load_e100(*this, iface); } -void mboard_eeprom_t::commit(i2c_iface &iface, map_type map) const{ - switch(map){ - case MAP_N100: store_n100(*this, iface); break; - case MAP_B000: store_b000(*this, iface); break; - case MAP_B100: store_b100(*this, iface); break; - case MAP_E100: store_e100(*this, iface); break; - } +void mboard_eeprom_t::commit(i2c_iface &iface, const std::string &which) const{ + if (which == "N100") store_n100(*this, iface); + if (which == "B000") store_b000(*this, iface); + if (which == "B100") store_b100(*this, iface); + if (which == "E100") store_e100(*this, iface); } |