X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=decoders%2Fdcf77%2Fpd.py;h=0f1d3d1910cf2dddba62f29395451448a4c9dc26;hb=d66d47eda43be865ca6775fe4f02cdd0824b6abb;hp=adee4037323df77428d4ed8c8e409d8c3348287f;hpb=35b380b1156434b73d4a976c68f5ab3604c8510a;p=libsigrokdecode.git diff --git a/decoders/dcf77/pd.py b/decoders/dcf77/pd.py index adee403..0f1d3d1 100644 --- a/decoders/dcf77/pd.py +++ b/decoders/dcf77/pd.py @@ -20,10 +20,7 @@ import sigrokdecode as srd import calendar - -# Return the specified BCD number (max. 8 bits) as integer. -def bcd2int(b): - return (b & 0x0f) + ((b >> 4) * 10) +from common.srdhelper import bcd2int class SamplerateError(Exception): pass @@ -68,7 +65,7 @@ class Decoder(srd.Decoder): ('warnings', 'Warnings', (19,)), ) - def __init__(self, **kwargs): + def __init__(self): self.samplerate = None self.state = 'WAIT FOR RISING EDGE' self.oldpins = None