diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2014-02-01 18:11:40 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2014-02-01 18:11:40 +0100 |
commit | e2ff870ec47cc01a24d037c75d16ebaccdf1ff69 (patch) | |
tree | 70a2571dc09191ef53949f9bc722cfb100555048 /decoders/guess_bitrate/pd.py | |
parent | b92233847c6a77dfb66ac2eaef3c2ef4ff57640c (diff) | |
download | libsigrokdecode-e2ff870ec47cc01a24d037c75d16ebaccdf1ff69.tar.gz libsigrokdecode-e2ff870ec47cc01a24d037c75d16ebaccdf1ff69.zip |
guess_bitrate: start() doesn't take a metadata argument anymore.
Diffstat (limited to 'decoders/guess_bitrate/pd.py')
-rw-r--r-- | decoders/guess_bitrate/pd.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/decoders/guess_bitrate/pd.py b/decoders/guess_bitrate/pd.py index 3249b31..b88a897 100644 --- a/decoders/guess_bitrate/pd.py +++ b/decoders/guess_bitrate/pd.py @@ -47,12 +47,17 @@ class Decoder(srd.Decoder): self.first_transition = True self.bitwidth = None - def start(self, metadata): - self.samplerate = metadata['samplerate'] + def start(self): # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) + def metadata(self, key, value): + if key == srd.SRD_CONF_SAMPLERATE: + self.samplerate = value; + def decode(self, ss, es, data): + if self.samplerate is None: + raise Exception("Cannot decode without samplerate.") for (self.samplenum, pins) in data: data = pins[0] |