From: Uwe Hermann Date: Tue, 10 Jan 2012 23:52:54 +0000 (+0100) Subject: srd: Drop duplicate SRD_ prefix from ANN/PROTO. X-Git-Tag: libsigrokdecode-0.1.0~176 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=56202222ed83ff030239bb23be8296574674c4f7;p=libsigrokdecode.git srd: Drop duplicate SRD_ prefix from ANN/PROTO. Using srd.SRD_OUTPUT_ANN is unneeded, srd.OUTPUT_ANN is better/shorter. --- diff --git a/decoders/ddc.py b/decoders/ddc.py index a628565..36d5c4a 100644 --- a/decoders/ddc.py +++ b/decoders/ddc.py @@ -45,7 +45,7 @@ class Decoder(srd.Decoder): self.state = None def start(self, metadata): - self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'ddc') + self.out_ann = self.add(srd.OUTPUT_ANN, 'ddc') def decode(self, start_sample, end_sample, i2c_data): try: diff --git a/decoders/i2c.py b/decoders/i2c.py index b8c56f7..11ee9b5 100644 --- a/decoders/i2c.py +++ b/decoders/i2c.py @@ -160,8 +160,8 @@ class Decoder(srd.Decoder): self.oldsda = None def start(self, metadata): - self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'i2c') - self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'i2c') + self.out_proto = self.add(srd.OUTPUT_PROTO, 'i2c') + self.out_ann = self.add(srd.OUTPUT_ANN, 'i2c') def report(self): pass diff --git a/decoders/mx25lxx05d.py b/decoders/mx25lxx05d.py index 4a87fa4..3f0dc18 100644 --- a/decoders/mx25lxx05d.py +++ b/decoders/mx25lxx05d.py @@ -177,8 +177,8 @@ class Decoder(srd.Decoder): self.out = [] def start(self, metadata): - # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'mx25lxx05d') - self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'mx25lxx05d') + # self.out_proto = self.add(srd.OUTPUT_PROTO, 'mx25lxx05d') + self.out_ann = self.add(srd.OUTPUT_ANN, 'mx25lxx05d') def report(self): pass diff --git a/decoders/nunchuk.py b/decoders/nunchuk.py index 86ec171..63fadc2 100644 --- a/decoders/nunchuk.py +++ b/decoders/nunchuk.py @@ -84,8 +84,8 @@ class Decoder(srd.Decoder): self.databytecount = 0 def start(self, metadata): - # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'nunchuk') - self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'nunchuk') + # self.out_proto = self.add(srd.OUTPUT_PROTO, 'nunchuk') + self.out_ann = self.add(srd.OUTPUT_ANN, 'nunchuk') def report(self): pass diff --git a/decoders/pan1321.py b/decoders/pan1321.py index 2d86679..3174ffe 100644 --- a/decoders/pan1321.py +++ b/decoders/pan1321.py @@ -54,8 +54,8 @@ class Decoder(srd.Decoder): self.cmd = '' def start(self, metadata): - # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'pan1321') - self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'pan1321') + # self.out_proto = self.add(srd.OUTPUT_PROTO, 'pan1321') + self.out_ann = self.add(srd.OUTPUT_ANN, 'pan1321') def report(self): pass diff --git a/decoders/spi.py b/decoders/spi.py index 9d3940e..3262aa4 100644 --- a/decoders/spi.py +++ b/decoders/spi.py @@ -44,8 +44,8 @@ class Decoder(srd.Decoder): self.bytesreceived = 0 def start(self, metadata): - # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'spi') - self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'spi') + # self.out_proto = self.add(srd.OUTPUT_PROTO, 'spi') + self.out_ann = self.add(srd.OUTPUT_ANN, 'spi') def report(self): return 'SPI: %d bytes received' % self.bytesreceived diff --git a/decoders/srd_usb.py b/decoders/srd_usb.py index c6e6627..f7afa65 100644 --- a/decoders/srd_usb.py +++ b/decoders/srd_usb.py @@ -122,8 +122,8 @@ class Decoder(srd.Decoder): def start(self, metadata): self.rate = metadata['samplerate'] - # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'usb') - self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'usb') + # self.out_proto = self.add(srd.OUTPUT_PROTO, 'usb') + self.out_ann = self.add(srd.OUTPUT_ANN, 'usb') if self.rate < 48000000: raise Exception("Sample rate not sufficient for USB decoding") # Initialise decoder state. diff --git a/decoders/transitioncounter.py b/decoders/transitioncounter.py index 6092258..5b12927 100644 --- a/decoders/transitioncounter.py +++ b/decoders/transitioncounter.py @@ -40,8 +40,8 @@ class Decoder(srd.Decoder): 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 diff --git a/decoders/uart.py b/decoders/uart.py index 4546521..24b5ba3 100644 --- a/decoders/uart.py +++ b/decoders/uart.py @@ -255,8 +255,8 @@ class Decoder(srd.Decoder): def start(self, metadata): self.samplerate = metadata['samplerate'] - self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'uart') - self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'uart') + self.out_proto = self.add(srd.OUTPUT_PROTO, 'uart') + self.out_ann = self.add(srd.OUTPUT_ANN, 'uart') # TODO ### self.baudrate = metadata['baudrate'] diff --git a/module_sigrokdecode.c b/module_sigrokdecode.c index d2ffb07..426cf49 100644 --- a/module_sigrokdecode.c +++ b/module_sigrokdecode.c @@ -230,13 +230,13 @@ PyMODINIT_FUNC PyInit_sigrokdecode(void) return NULL; /* expose output types as symbols in the sigrokdecode module */ - if(PyModule_AddObject(mod, "SRD_OUTPUT_ANN", + if(PyModule_AddObject(mod, "OUTPUT_ANN", PyLong_FromLong(SRD_OUTPUT_ANN)) == -1) return NULL; - if(PyModule_AddObject(mod, "SRD_OUTPUT_PROTO", + if(PyModule_AddObject(mod, "OUTPUT_PROTO", PyLong_FromLong(SRD_OUTPUT_PROTO)) == -1) return NULL; - if(PyModule_AddObject(mod, "SRD_OUTPUT_BINARY", + if(PyModule_AddObject(mod, "OUTPUT_BINARY", PyLong_FromLong(SRD_OUTPUT_BINARY)) == -1) return NULL;