summaryrefslogtreecommitdiff
path: root/decoders/cfp
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2018-06-10 16:25:40 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2018-06-10 19:24:23 +0200
commit824287c405e3562999a80a8965860d9ee1c4c2d1 (patch)
treed58e28ccd995306841cd819e4c584298acd710f1 /decoders/cfp
parentfd75ec3b6169318352e7ef11fa84f5878a0ad8d1 (diff)
downloadlibsigrokdecode-824287c405e3562999a80a8965860d9ee1c4c2d1.tar.gz
libsigrokdecode-824287c405e3562999a80a8965860d9ee1c4c2d1.zip
cfp: Use the Python in/range keywords.
Diffstat (limited to 'decoders/cfp')
-rw-r--r--decoders/cfp/pd.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/decoders/cfp/pd.py b/decoders/cfp/pd.py
index 71229ce..dec2e41 100644
--- a/decoders/cfp/pd.py
+++ b/decoders/cfp/pd.py
@@ -81,26 +81,26 @@ class Decoder(srd.Decoder):
for (clause45, clause45_addr, is_read, portad, devad, reg) in data:
if not is_read:
continue
- if clause45_addr >= 0x8000 and clause45_addr <= 0x807F:
+ if clause45_addr in range(0x8000, 0x807F + 1):
self.putx([0, ['CFP NVR 1: Basic ID register', 'NVR1']])
if clause45_addr == 0x8000:
self.putx([1, ['Module identifier: %s' % \
MODULE_ID.get(reg, 'Reserved')]])
- elif clause45_addr >= 0x8080 and clause45_addr <= 0x80FF:
+ elif clause45_addr in range(0x8080, 0x80FF + 1):
self.putx([0, ['CFP NVR 2: Extended ID register', 'NVR2']])
- elif clause45_addr >= 0x8100 and clause45_addr <= 0x817F:
+ elif clause45_addr in range(0x8100, 0x817F + 1):
self.putx([0, ['CFP NVR 3: Network lane specific register', 'NVR3']])
- elif clause45_addr >= 0x8180 and clause45_addr <= 0x81FF:
+ elif clause45_addr in range(0x8180, 0x81FF + 1):
self.putx([0, ['CFP NVR 4', 'NVR4']])
- elif clause45_addr >= 0x8400 and clause45_addr <= 0x847F:
+ elif clause45_addr in range(0x8400, 0x847F + 1):
self.putx([0, ['Vendor NVR 1: Vendor data register', 'V-NVR1']])
- elif clause45_addr >= 0x8480 and clause45_addr <= 0x84FF:
+ elif clause45_addr in range(0x8480, 0x84FF + 1):
self.putx([0, ['Vendor NVR 2: Vendor data register', 'V-NVR2']])
- elif clause45_addr >= 0x8800 and clause45_addr <= 0x887F:
+ elif clause45_addr in range(0x8800, 0x887F + 1):
self.putx([0, ['User NVR 1: User data register', 'U-NVR1']])
- elif clause45_addr >= 0x8880 and clause45_addr <= 0x88FF:
+ elif clause45_addr in range(0x8880, 0x88FF + 1):
self.putx([0, ['User NVR 2: User data register', 'U-NVR2']])
- elif clause45_addr >= 0xA000 and clause45_addr <= 0xA07F:
+ elif clause45_addr in range(0xA000, 0xA07F + 1):
self.putx([0, ['CFP Module VR 1: CFP Module level control and DDM register', 'Mod-VR1']])
- elif clause45_addr >= 0xA080 and clause45_addr <= 0xA0FF:
+ elif clause45_addr in range(0xA080, 0xA0FF + 1):
self.putx([0, ['MLG VR 1: MLG Management Interface register', 'MLG-VR1']])