diff options
Diffstat (limited to 'decoders/ir_rc5/pd.py')
-rw-r--r-- | decoders/ir_rc5/pd.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/decoders/ir_rc5/pd.py b/decoders/ir_rc5/pd.py index 885b29d..bd99826 100644 --- a/decoders/ir_rc5/pd.py +++ b/decoders/ir_rc5/pd.py @@ -21,6 +21,9 @@ import sigrokdecode as srd from .lists import * +class SamplerateError(Exception): + pass + class Decoder(srd.Decoder): api_version = 2 id = 'ir_rc5' @@ -133,8 +136,8 @@ class Decoder(srd.Decoder): self.state = 'IDLE' def decode(self, ss, es, data): - if self.samplerate is None: - raise Exception("Cannot decode without samplerate.") + if not self.samplerate: + raise SamplerateError('Cannot decode without samplerate.') for (self.samplenum, pins) in data: self.ir = pins[0] |