From: Bert Vermeulen Date: Tue, 5 Nov 2013 10:21:33 +0000 (+0100) Subject: Rename inter-PD output type to SRD_OUTPUT_PYTHON X-Git-Tag: libsigrokdecode-0.3.0~243 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f2a5df42ea41e6c4370d4efa1a27ab942ba1ddff;p=libsigrokdecode.git Rename inter-PD output type to SRD_OUTPUT_PYTHON This better reflects what it is: a python object generated and processed by python code. --- diff --git a/decoders/avr_isp/pd.py b/decoders/avr_isp/pd.py index 731f847..27b5118 100644 --- a/decoders/avr_isp/pd.py +++ b/decoders/avr_isp/pd.py @@ -51,7 +51,7 @@ class Decoder(srd.Decoder): self.xx, self.yy, self.zz, self.mm = 0, 0, 0, 0 def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'avr_isp') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'avr_isp') self.out_ann = self.add(srd.OUTPUT_ANN, 'avr_isp') def report(self): diff --git a/decoders/can/pd.py b/decoders/can/pd.py index 91ccf42..2e58c0a 100644 --- a/decoders/can/pd.py +++ b/decoders/can/pd.py @@ -64,7 +64,7 @@ class Decoder(srd.Decoder): self.reset_variables() def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'can') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'can') self.out_ann = self.add(srd.OUTPUT_ANN, 'can') def metadata(self, key, value): diff --git a/decoders/dcf77/pd.py b/decoders/dcf77/pd.py index 57cd448..9a273b2 100644 --- a/decoders/dcf77/pd.py +++ b/decoders/dcf77/pd.py @@ -76,7 +76,7 @@ class Decoder(srd.Decoder): self.dcf77_bitnumber_is_known = 0 def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'dcf77') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'dcf77') self.out_ann = self.add(srd.OUTPUT_ANN, 'dcf77') def metadata(self, key, value): diff --git a/decoders/guess_bitrate/pd.py b/decoders/guess_bitrate/pd.py index 585bd76..3eaa1e9 100644 --- a/decoders/guess_bitrate/pd.py +++ b/decoders/guess_bitrate/pd.py @@ -51,7 +51,7 @@ class Decoder(srd.Decoder): def start(self, metadata): self.samplerate = metadata['samplerate'] - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'guess_bitrate') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'guess_bitrate') self.out_ann = self.add(srd.OUTPUT_ANN, 'guess_bitrate') def report(self): diff --git a/decoders/i2c/pd.py b/decoders/i2c/pd.py index dcc27b2..da80567 100644 --- a/decoders/i2c/pd.py +++ b/decoders/i2c/pd.py @@ -106,7 +106,7 @@ class Decoder(srd.Decoder): self.oldpins = [1, 1] def start(self): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'i2c') + self.out_proto = self.add(srd.OUTPUT_PYTHON, 'i2c') self.out_ann = self.add(srd.OUTPUT_ANN, 'i2c') def report(self): diff --git a/decoders/i2cdemux/pd.py b/decoders/i2cdemux/pd.py index b075129..1e1d09c 100644 --- a/decoders/i2cdemux/pd.py +++ b/decoders/i2cdemux/pd.py @@ -68,7 +68,7 @@ class Decoder(srd.Decoder): # We're never seen this slave, add a new stream. self.slaves.append(databyte) - self.out_proto.append(self.add(srd.OUTPUT_PROTO, + self.out_proto.append(self.add(srd.OUTPUT_PYTHON, 'i2c-%s' % hex(databyte))) self.stream = self.streamcount self.streamcount += 1 diff --git a/decoders/i2cfilter/pd.py b/decoders/i2cfilter/pd.py index c0f9a0b..4586cf7 100644 --- a/decoders/i2cfilter/pd.py +++ b/decoders/i2cfilter/pd.py @@ -48,7 +48,7 @@ class Decoder(srd.Decoder): self.packets = [] # Local cache of I2C packets def start(self): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'i2c') + self.out_proto = self.add(srd.OUTPUT_PYTHON, 'i2c') if self.options['address'] not in range(0, 127 + 1): raise Exception('Invalid slave (must be 0..127).') if self.options['direction'] not in ('both', 'read', 'write'): diff --git a/decoders/i2s/pd.py b/decoders/i2s/pd.py index 91d261a..292a4c4 100644 --- a/decoders/i2s/pd.py +++ b/decoders/i2s/pd.py @@ -69,7 +69,7 @@ class Decoder(srd.Decoder): self.wordlength = -1 def start(self): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'i2s') + self.out_proto = self.add(srd.OUTPUT_PYTHON, 'i2s') self.out_ann = self.add(srd.OUTPUT_ANN, 'i2s') def metadata(self, key, value): diff --git a/decoders/jtag/pd.py b/decoders/jtag/pd.py index 0301d80..e327d32 100644 --- a/decoders/jtag/pd.py +++ b/decoders/jtag/pd.py @@ -57,7 +57,7 @@ class Decoder(srd.Decoder): self.bits_tdo = [] def start(self): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'jtag') + self.out_proto = self.add(srd.OUTPUT_PYTHON, 'jtag') self.out_ann = self.add(srd.OUTPUT_ANN, 'jtag') def report(self): diff --git a/decoders/jtag_stm32/pd.py b/decoders/jtag_stm32/pd.py index 5dba787..fee2088 100644 --- a/decoders/jtag_stm32/pd.py +++ b/decoders/jtag_stm32/pd.py @@ -141,7 +141,7 @@ class Decoder(srd.Decoder): # self.state = 'BYPASS' def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'jtag_stm32') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'jtag_stm32') self.out_ann = self.add(srd.OUTPUT_ANN, 'jtag_stm32') def report(self): diff --git a/decoders/lm75/pd.py b/decoders/lm75/pd.py index 8e447b7..de1a0da 100644 --- a/decoders/lm75/pd.py +++ b/decoders/lm75/pd.py @@ -78,7 +78,7 @@ class Decoder(srd.Decoder): self.avgvalues = [] def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'lm75') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'lm75') self.out_ann = self.add(srd.OUTPUT_ANN, 'lm75') def report(self): diff --git a/decoders/lpc/pd.py b/decoders/lpc/pd.py index abc161d..b4adb5b 100644 --- a/decoders/lpc/pd.py +++ b/decoders/lpc/pd.py @@ -151,7 +151,7 @@ class Decoder(srd.Decoder): self.ss_block = self.es_block = None def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'lpc') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'lpc') self.out_ann = self.add(srd.OUTPUT_ANN, 'lpc') def report(self): diff --git a/decoders/midi/pd.py b/decoders/midi/pd.py index 080f2b3..371bcd5 100644 --- a/decoders/midi/pd.py +++ b/decoders/midi/pd.py @@ -52,7 +52,7 @@ class Decoder(srd.Decoder): self.es_block = None def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'midi') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'midi') self.out_ann = self.add(srd.OUTPUT_ANN, 'midi') def report(self): diff --git a/decoders/mlx90614/pd.py b/decoders/mlx90614/pd.py index c4a47c4..67a852c 100644 --- a/decoders/mlx90614/pd.py +++ b/decoders/mlx90614/pd.py @@ -44,7 +44,7 @@ class Decoder(srd.Decoder): self.data = [] def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'mlx90614') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'mlx90614') self.out_ann = self.add(srd.OUTPUT_ANN, 'mlx90614') def report(self): diff --git a/decoders/mx25lxx05d/pd.py b/decoders/mx25lxx05d/pd.py index 35809f3..856497b 100644 --- a/decoders/mx25lxx05d/pd.py +++ b/decoders/mx25lxx05d/pd.py @@ -111,7 +111,7 @@ class Decoder(srd.Decoder): self.data = [] def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'mx25lxx05d') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'mx25lxx05d') self.out_ann = self.add(srd.OUTPUT_ANN, 'mx25lxx05d') def report(self): diff --git a/decoders/mxc6225xu/pd.py b/decoders/mxc6225xu/pd.py index ca24cd5..e707b75 100644 --- a/decoders/mxc6225xu/pd.py +++ b/decoders/mxc6225xu/pd.py @@ -83,7 +83,7 @@ class Decoder(srd.Decoder): self.state = 'IDLE' def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'mxc6225xu') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'mxc6225xu') self.out_ann = self.add(srd.OUTPUT_ANN, 'mxc6225xu') def report(self): diff --git a/decoders/nunchuk/pd.py b/decoders/nunchuk/pd.py index b272338..544802e 100644 --- a/decoders/nunchuk/pd.py +++ b/decoders/nunchuk/pd.py @@ -48,7 +48,7 @@ class Decoder(srd.Decoder): self.init_seq = [] def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'nunchuk') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'nunchuk') self.out_ann = self.add(srd.OUTPUT_ANN, 'nunchuk') def report(self): diff --git a/decoders/onewire_link/pd.py b/decoders/onewire_link/pd.py index 4a826d1..34cd4f4 100644 --- a/decoders/onewire_link/pd.py +++ b/decoders/onewire_link/pd.py @@ -92,7 +92,7 @@ class Decoder(srd.Decoder): self.rise = 0 def start(self): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'onewire_link') + self.out_proto = self.add(srd.OUTPUT_PYTHON, 'onewire_link') self.out_ann = self.add(srd.OUTPUT_ANN, 'onewire_link') def metadata(self, key, value): diff --git a/decoders/onewire_network/pd.py b/decoders/onewire_network/pd.py index 6db95ec..1099bdc 100644 --- a/decoders/onewire_network/pd.py +++ b/decoders/onewire_network/pd.py @@ -62,7 +62,7 @@ class Decoder(srd.Decoder): self.rom = 0x0000000000000000 def start(self): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'onewire_network') + self.out_proto = self.add(srd.OUTPUT_PYTHON, 'onewire_network') self.out_ann = self.add(srd.OUTPUT_ANN, 'onewire_network') def report(self): diff --git a/decoders/pan1321/pd.py b/decoders/pan1321/pd.py index 9b5cf15..42cace2 100644 --- a/decoders/pan1321/pd.py +++ b/decoders/pan1321/pd.py @@ -49,7 +49,7 @@ class Decoder(srd.Decoder): self.ss_block = None def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'pan1321') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'pan1321') self.out_ann = self.add(srd.OUTPUT_ANN, 'pan1321') def report(self): diff --git a/decoders/parallel/pd.py b/decoders/parallel/pd.py index abb77c6..2de9dde 100644 --- a/decoders/parallel/pd.py +++ b/decoders/parallel/pd.py @@ -99,7 +99,7 @@ class Decoder(srd.Decoder): self.state = 'IDLE' def start(self, metadata): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'parallel') + self.out_proto = self.add(srd.OUTPUT_PYTHON, 'parallel') self.out_ann = self.add(srd.OUTPUT_ANN, 'parallel') def report(self): diff --git a/decoders/rtc8564/pd.py b/decoders/rtc8564/pd.py index 5709f62..e7ae036 100644 --- a/decoders/rtc8564/pd.py +++ b/decoders/rtc8564/pd.py @@ -56,7 +56,7 @@ class Decoder(srd.Decoder): self.years = -1 def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'rtc8564') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'rtc8564') self.out_ann = self.add(srd.OUTPUT_ANN, 'rtc8564') def report(self): diff --git a/decoders/sdcard_spi/pd.py b/decoders/sdcard_spi/pd.py index cc286fa..0d93d16 100644 --- a/decoders/sdcard_spi/pd.py +++ b/decoders/sdcard_spi/pd.py @@ -98,7 +98,7 @@ class Decoder(srd.Decoder): self.read_buf = [] def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'sdcard_spi') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'sdcard_spi') self.out_ann = self.add(srd.OUTPUT_ANN, 'sdcard_spi') def report(self): diff --git a/decoders/spi/pd.py b/decoders/spi/pd.py index d18af85..888cbd3 100644 --- a/decoders/spi/pd.py +++ b/decoders/spi/pd.py @@ -101,7 +101,7 @@ class Decoder(srd.Decoder): self.state = 'IDLE' def start(self): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'spi') + self.out_proto = self.add(srd.OUTPUT_PYTHON, 'spi') self.out_ann = self.add(srd.OUTPUT_ANN, 'spi') def report(self): diff --git a/decoders/tlc5620/pd.py b/decoders/tlc5620/pd.py index 4e9a3b7..313adca 100644 --- a/decoders/tlc5620/pd.py +++ b/decoders/tlc5620/pd.py @@ -65,7 +65,7 @@ class Decoder(srd.Decoder): self.dac_select = self.gain = self.dac_value = None def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'tlc5620') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'tlc5620') self.out_ann = self.add(srd.OUTPUT_ANN, 'tlc5620') def report(self): diff --git a/decoders/transitioncounter/pd.py b/decoders/transitioncounter/pd.py index 00fbfcf..45446e2 100644 --- a/decoders/transitioncounter/pd.py +++ b/decoders/transitioncounter/pd.py @@ -43,7 +43,7 @@ class Decoder(srd.Decoder): self.lastsample = None def start(self): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'transitioncounter') + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'transitioncounter') self.out_ann = self.add(srd.OUTPUT_ANN, 'transitioncounter') def report(self): diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py index ab96886..32568da 100644 --- a/decoders/uart/pd.py +++ b/decoders/uart/pd.py @@ -132,7 +132,7 @@ class Decoder(srd.Decoder): self.oldpins = [1, 1] def start(self): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'uart') + self.out_proto = self.add(srd.OUTPUT_PYTHON, 'uart') self.out_ann = self.add(srd.OUTPUT_ANN, 'uart') def metadata(self, key, value): diff --git a/decoders/usb_packet/pd.py b/decoders/usb_packet/pd.py index d799cd5..5b3c5e6 100644 --- a/decoders/usb_packet/pd.py +++ b/decoders/usb_packet/pd.py @@ -176,7 +176,7 @@ class Decoder(srd.Decoder): self.put(self.ss_packet, self.es_packet, self.out_ann, data) def start(self): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'usb_packet') + self.out_proto = self.add(srd.OUTPUT_PYTHON, 'usb_packet') self.out_ann = self.add(srd.OUTPUT_ANN, 'usb_packet') def report(self): diff --git a/decoders/usb_signalling/pd.py b/decoders/usb_signalling/pd.py index 8a323e0..0d21d22 100644 --- a/decoders/usb_signalling/pd.py +++ b/decoders/usb_signalling/pd.py @@ -109,7 +109,7 @@ class Decoder(srd.Decoder): self.state = 'IDLE' def start(self): - self.out_proto = self.add(srd.OUTPUT_PROTO, 'usb_signalling') + self.out_proto = self.add(srd.OUTPUT_PYTHON, 'usb_signalling') self.out_ann = self.add(srd.OUTPUT_ANN, 'usb_signalling') def metadata(self, key, value): diff --git a/libsigrokdecode.h.in b/libsigrokdecode.h.in index 3eaace6..cec6def 100644 --- a/libsigrokdecode.h.in +++ b/libsigrokdecode.h.in @@ -160,7 +160,7 @@ enum { */ enum { SRD_OUTPUT_ANN, - SRD_OUTPUT_PROTO, + SRD_OUTPUT_PYTHON, SRD_OUTPUT_BINARY, }; diff --git a/module_sigrokdecode.c b/module_sigrokdecode.c index 6fba05c..46b3ced 100644 --- a/module_sigrokdecode.c +++ b/module_sigrokdecode.c @@ -71,8 +71,8 @@ PyMODINIT_FUNC PyInit_sigrokdecode(void) /* expose output types as symbols in the sigrokdecode module */ if (PyModule_AddIntConstant(mod, "OUTPUT_ANN", SRD_OUTPUT_ANN) == -1) return NULL; - if (PyModule_AddIntConstant(mod, "OUTPUT_PROTO", - SRD_OUTPUT_PROTO) == -1) + if (PyModule_AddIntConstant(mod, "OUTPUT_PYTHON", + SRD_OUTPUT_PYTHON) == -1) return NULL; if (PyModule_AddIntConstant(mod, "OUTPUT_BINARY", SRD_OUTPUT_BINARY) == -1) diff --git a/type_decoder.c b/type_decoder.c index c8ef09e..f689dd0 100644 --- a/type_decoder.c +++ b/type_decoder.c @@ -25,7 +25,7 @@ /* This is only used for nicer srd_dbg() output. */ static const char *OUTPUT_TYPES[] = { "OUTPUT_ANN", - "OUTPUT_PROTO", + "OUTPUT_PYTHON", "OUTPUT_BINARY", }; @@ -145,7 +145,7 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args) cb->cb(pdata, cb->cb_data); } break; - case SRD_OUTPUT_PROTO: + case SRD_OUTPUT_PYTHON: for (l = di->next_di; l; l = l->next) { next_di = l->data; /* TODO: Is this needed? */