X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Ftransitioncounter.py;h=8cb32bb772029507ec8e721f3bf3622e61843dd5;hb=526e580446dd45c3cb6811dd69a31eaff54e908e;hp=6092258d44b6ea25706dc686fff691723c875402;hpb=d0e93c76e381eff58ca23949301f781b24ba4a8b;p=libsigrokdecode.git diff --git a/decoders/transitioncounter.py b/decoders/transitioncounter.py index 6092258..8cb32bb 100644 --- a/decoders/transitioncounter.py +++ b/decoders/transitioncounter.py @@ -23,7 +23,7 @@ import sigrokdecode as srd class Decoder(srd.Decoder): id = 'transitioncounter' name = 'Transition counter' - longname = '...' + longname = 'Pin transition counter' desc = 'Counts rising/falling edges in the signal.' longdesc = '...' author = 'Uwe Hermann' @@ -31,22 +31,24 @@ class Decoder(srd.Decoder): license = 'gplv2+' inputs = ['logic'] outputs = ['transitioncounts'] - probes = [ - ] # TODO? + probes = [] options = {} + annotations = [ + ['TODO', 'TODO'], + ] def __init__(self, **kwargs): self.channels = -1 self.lastsample = None def start(self, metadata): - # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'transitioncounter') - self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'transitioncounter') + # self.out_proto = self.add(srd.OUTPUT_PROTO, 'transitioncounter') + self.out_ann = self.add(srd.OUTPUT_ANN, 'transitioncounter') def report(self): pass - def decode(self, timeoffset, duration, data): + def decode(self, ss, es, data): for (samplenum, s) in data: @@ -96,5 +98,5 @@ class Decoder(srd.Decoder): if outdata != []: # self.put(0, 0, self.out_proto, out_proto) - self.put(0, 0, self.out_ann, outdata) + self.put(0, 0, self.out_ann, [0, [str(outdata)]])