diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2018-06-10 16:15:48 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2018-06-10 19:24:23 +0200 |
commit | 9a80e8a18c9e06d996d59ffb89333f07c9ee2da3 (patch) | |
tree | 5fcf921317ea786afa8363d5fe77a0068105555f | |
parent | 5b2c45db1db190ba7f921b0808c123c6e48a47f3 (diff) | |
download | libsigrokdecode-9a80e8a18c9e06d996d59ffb89333f07c9ee2da3.tar.gz libsigrokdecode-9a80e8a18c9e06d996d59ffb89333f07c9ee2da3.zip |
cfp: Reduce indentation level.
-rw-r--r-- | decoders/cfp/pd.py | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/decoders/cfp/pd.py b/decoders/cfp/pd.py index 78e4ebb..56d7483 100644 --- a/decoders/cfp/pd.py +++ b/decoders/cfp/pd.py @@ -75,26 +75,27 @@ class Decoder(srd.Decoder): def decode(self, ss, es, data): for (clause45, clause45_address, is_read, portad, devad, register) in data: - if is_read: - if clause45_address >= 0x8000 and clause45_address <= 0x807F: - self.put(ss, es, self.out_ann, [0, ['CFP NVR 1: Basic ID register', 'NVR1']]) - if clause45_address == 0x8000: - self.put(ss, es, self.out_ann, [1, ['Module identifier: %s' % MODULE_ID.get(register, 'Reserved')]]) - elif clause45_address >= 0x8080 and clause45_address <= 0x80FF: - self.put(ss, es, self.out_ann, [0, ['CFP NVR 2: Extended ID register', 'NVR2']]) - elif clause45_address >= 0x8100 and clause45_address <= 0x817F: - self.put(ss, es, self.out_ann, [0, ['CFP NVR 3: Network lane specific register', 'NVR3']]) - elif clause45_address >= 0x8180 and clause45_address <= 0x81FF: - self.put(ss, es, self.out_ann, [0, ['CFP NVR 4', 'NVR4']]) - elif clause45_address >= 0x8400 and clause45_address <= 0x847F: - self.put(ss, es, self.out_ann, [0, ['Vendor NVR 1: Vendor data register', 'V-NVR1']]) - elif clause45_address >= 0x8480 and clause45_address <= 0x84FF: - self.put(ss, es, self.out_ann, [0, ['Vendor NVR 2: Vendor data register', 'V-NVR2']]) - elif clause45_address >= 0x8800 and clause45_address <= 0x887F: - self.put(ss, es, self.out_ann, [0, ['User NVR 1: User data register', 'U-NVR1']]) - elif clause45_address >= 0x8880 and clause45_address <= 0x88FF: - self.put(ss, es, self.out_ann, [0, ['User NVR 2: User data register', 'U-NVR2']]) - elif clause45_address >= 0xA000 and clause45_address <= 0xA07F: - self.put(ss, es, self.out_ann, [0, ['CFP Module VR 1: CFP Module level control and DDM register', 'Mod-VR1']]) - elif clause45_address >= 0xA080 and clause45_address <= 0xA0FF: - self.put(ss, es, self.out_ann, [0, ['MLG VR 1: MLG Management Interface register', 'MLG-VR1']]) + if not is_read: + continue + if clause45_address >= 0x8000 and clause45_address <= 0x807F: + self.put(ss, es, self.out_ann, [0, ['CFP NVR 1: Basic ID register', 'NVR1']]) + if clause45_address == 0x8000: + self.put(ss, es, self.out_ann, [1, ['Module identifier: %s' % MODULE_ID.get(register, 'Reserved')]]) + elif clause45_address >= 0x8080 and clause45_address <= 0x80FF: + self.put(ss, es, self.out_ann, [0, ['CFP NVR 2: Extended ID register', 'NVR2']]) + elif clause45_address >= 0x8100 and clause45_address <= 0x817F: + self.put(ss, es, self.out_ann, [0, ['CFP NVR 3: Network lane specific register', 'NVR3']]) + elif clause45_address >= 0x8180 and clause45_address <= 0x81FF: + self.put(ss, es, self.out_ann, [0, ['CFP NVR 4', 'NVR4']]) + elif clause45_address >= 0x8400 and clause45_address <= 0x847F: + self.put(ss, es, self.out_ann, [0, ['Vendor NVR 1: Vendor data register', 'V-NVR1']]) + elif clause45_address >= 0x8480 and clause45_address <= 0x84FF: + self.put(ss, es, self.out_ann, [0, ['Vendor NVR 2: Vendor data register', 'V-NVR2']]) + elif clause45_address >= 0x8800 and clause45_address <= 0x887F: + self.put(ss, es, self.out_ann, [0, ['User NVR 1: User data register', 'U-NVR1']]) + elif clause45_address >= 0x8880 and clause45_address <= 0x88FF: + self.put(ss, es, self.out_ann, [0, ['User NVR 2: User data register', 'U-NVR2']]) + elif clause45_address >= 0xA000 and clause45_address <= 0xA07F: + self.put(ss, es, self.out_ann, [0, ['CFP Module VR 1: CFP Module level control and DDM register', 'Mod-VR1']]) + elif clause45_address >= 0xA080 and clause45_address <= 0xA0FF: + self.put(ss, es, self.out_ann, [0, ['MLG VR 1: MLG Management Interface register', 'MLG-VR1']]) |