diff options
author | Matthew Crymble <matthew.crymble@ni.com> | 2019-09-10 15:44:40 -0500 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2019-09-24 17:23:44 -0700 |
commit | f47d805cc3999a98055c9a1ee132a40c2f58d515 (patch) | |
tree | 489f871adf78b3e46dc4e58fcee40103a2f1e01e /mpm/python/usrp_mpm/periph_manager/base.py | |
parent | 22b9593dce1ad034ef84ee3609d2ccbceeb33098 (diff) | |
download | uhd-f47d805cc3999a98055c9a1ee132a40c2f58d515.tar.gz uhd-f47d805cc3999a98055c9a1ee132a40c2f58d515.tar.bz2 uhd-f47d805cc3999a98055c9a1ee132a40c2f58d515.zip |
mpm: fixed mboard_max_revision value
This value should be 9 to correspond with the rev J motherboards.
This property was renamed to mboard_last_rev_compat in a previous commit.
But mboard_max_rev is actually a more accurate description,
since it specifies the latest hardware revision that the software
is aware of. I renamed all references back to mboard_max_rev.
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/base.py')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/base.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index a3adc56c8..430082604 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -85,7 +85,7 @@ class PeriphManagerBase(object): # For checking revision numbers, this is the highest revision that this # particular version of MPM supports. Leave at None to skip a max rev # check. - mboard_last_rev_compat = None + mboard_max_rev = None # A list of available sensors on the motherboard. This dictionary is a map # of the form sensor_name -> method name mboard_sensor_callback_map = {} @@ -288,15 +288,10 @@ class PeriphManagerBase(object): ) raise RuntimeError("Invalid PID found in EEPROM.") # The rev_compat is either directly stored in the EEPROM, or we fall - # back first to the dt_compat, then the rev itself (because every rev is - # compatible with itself). - # The dt_compat solution is a technically a hack, but it works because - # all hardware we have released until we made this change happened to - # have a dt_compat that also works as a rev_compat. + # back to the the rev itself (because every rev is compatible with + # itself). rev_compat = \ - eeprom_head.get('rev_compat', - eeprom_head.get('dt_compat', - eeprom_head.get('rev'))) + eeprom_head.get('rev_compat', eeprom_head.get('rev')) try: rev_compat = int(rev_compat) except (ValueError, TypeError): @@ -307,16 +302,16 @@ class PeriphManagerBase(object): # In order for the software to be able to understand the hardware, the # rev_compat value (stored on the EEPROM) must be smaller or equal to # the value stored in the software itself. - if self.mboard_last_rev_compat is None: + if self.mboard_max_rev is None: self.log.warning("Skipping HW/SW compatibility check!") else: - if rev_compat > self.mboard_last_rev_compat: + if rev_compat > self.mboard_max_rev: raise RuntimeError( "Software is maximally compatible with revision `{}', but " "the hardware has revision `{}' and is minimally compatible " "with hardware revision `{}'. Please upgrade your version of" "MPM in order to use this device." - .format(self.mboard_last_rev_compat, mboard_info['rev'], rev_compat) + .format(self.mboard_max_rev, mboard_info['rev'], rev_compat) ) return mboard_info |