From: Uwe Hermann Date: Fri, 10 Jan 2020 20:35:00 +0000 (+0100) Subject: sda2506: Use SrdIntEnum for pins. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c81a365e0e81482c601371f9be8a47a048a0aae0;p=libsigrokdecode.git sda2506: Use SrdIntEnum for pins. --- diff --git a/decoders/sda2506/pd.py b/decoders/sda2506/pd.py index 5b071d8..6df5755 100644 --- a/decoders/sda2506/pd.py +++ b/decoders/sda2506/pd.py @@ -19,6 +19,9 @@ import re import sigrokdecode as srd +from common.srdhelper import SrdIntEnum + +Pin = SrdIntEnum.from_str('Pin', 'CLK DATA CE') ann_cmdbit, ann_databit, ann_cmd, ann_data, ann_warning = range(5) @@ -88,8 +91,8 @@ class Decoder(srd.Decoder): def decode(self): while True: - # Wait for CLK edge or CE edge. - clk, d, ce = self.wait([{0: 'e'}, {2: 'e'}]) + # Wait for CLK edge or CE# edge. + clk, d, ce = self.wait([{Pin.CLK: 'e'}, {Pin.CE: 'e'}]) if self.matched[0] and ce == 1 and clk == 1: # Rising clk edge and command mode.