X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Ftransitioncounter.py;h=eaf87389e16908c3c621b8a2a2c36372e34b83d1;hb=677d597b072c0a1d2df81c5c193cd3678aef8d03;hp=2847abc345cafb50af27b0f86183750ba9a97c5b;hpb=2fd89a85c4a1131ca259d794a43b26b8bd84b6a0;p=libsigrokdecode.git diff --git a/decoders/transitioncounter.py b/decoders/transitioncounter.py index 2847abc..eaf8738 100644 --- a/decoders/transitioncounter.py +++ b/decoders/transitioncounter.py @@ -18,9 +18,9 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -import sigrokdecode +import sigrokdecode as srd -class Decoder(sigrokdecode.Decoder): +class Decoder(srd.Decoder): id = 'transitioncounter' name = 'Transition counter' longname = '...' @@ -36,14 +36,14 @@ class Decoder(sigrokdecode.Decoder): options = {} def __init__(self, **kwargs): - self.output_protocol = None - self.output_annotation = None + self.out_proto = None + self.out_ann = None self.channels = -1 self.lastsample = None def start(self, metadata): - # self.output_protocol = self.add(2) - self.output_annotation = self.add(1) + # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'transitioncounter') + self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'transitioncounter') def report(self): pass @@ -97,6 +97,6 @@ class Decoder(sigrokdecode.Decoder): outdata += [[self.transitions[i], self.rising[i], self.falling[i]]] if outdata != []: - # self.put(0, 0, self.output_protocol, out_proto) - self.put(0, 0, self.output_annotation, outdata) + # self.put(0, 0, self.out_proto, out_proto) + self.put(0, 0, self.out_ann, outdata)