diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2018-04-08 18:41:59 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2018-04-08 19:09:02 +0200 |
commit | 8c8cb5917e7bf029042f2161673b3cef3c2a6835 (patch) | |
tree | 9642e3d4d8ab0f6da4c5f9156fb72e503a934ab6 /decoders | |
parent | 2a2c9b1635c38e4c0a1078fd8c9ec45cc45bd688 (diff) | |
download | libsigrokdecode-8c8cb5917e7bf029042f2161673b3cef3c2a6835.tar.gz libsigrokdecode-8c8cb5917e7bf029042f2161673b3cef3c2a6835.zip |
rc_encode: Drop unneeded casts.
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/rc_encode/pd.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/decoders/rc_encode/pd.py b/decoders/rc_encode/pd.py index ec0cb99..902594c 100644 --- a/decoders/rc_encode/pd.py +++ b/decoders/rc_encode/pd.py @@ -26,19 +26,19 @@ def decode_bit(edges): eqmin = 0.5 # equal min multiplier eqmax = 1.5 # equal max multiplier if ( # 0 -___-___ - (int(edges[1]) >= int(edges[0]) * lmin and int(edges[1]) <= int(edges[0]) * lmax) and - (int(edges[2]) >= int(edges[0]) * eqmin and int(edges[2]) <= int(edges[0]) * eqmax) and - (int(edges[3]) >= int(edges[0]) * lmin and int(edges[3]) <= int(edges[0]) * lmax)): + (edges[1] >= edges[0] * lmin and edges[1] <= edges[0] * lmax) and + (edges[2] >= edges[0] * eqmin and edges[2] <= edges[0] * eqmax) and + (edges[3] >= edges[0] * lmin and edges[3] <= edges[0] * lmax)): return '0' elif ( # 1 ---_---_ - (int(edges[0]) >= int(edges[1]) * lmin and int(edges[0]) <= int(edges[1]) * lmax) and - (int(edges[0]) >= int(edges[2]) * eqmin and int(edges[0]) <= int(edges[2]) * eqmax) and - (int(edges[0]) >= int(edges[3]) * lmin and int(edges[0]) <= int(edges[3]) * lmax)): + (edges[0] >= edges[1] * lmin and edges[0] <= edges[1] * lmax) and + (edges[0] >= edges[2] * eqmin and edges[0] <= edges[2] * eqmax) and + (edges[0] >= edges[3] * lmin and edges[0] <= edges[3] * lmax)): return '1' elif ( # float ---_-___ - (int(edges[1]) >= int(edges[0]) * lmin and int(edges[1]) <= int(edges[0]) * lmax) and - (int(edges[2]) >= int(edges[0]) * lmin and int(edges[2]) <= int(edges[0]) * lmax) and - (int(edges[3]) >= int(edges[0]) * eqmin and int(edges[3]) <= int(edges[0]) * eqmax)): + (edges[1] >= edges[0] * lmin and edges[1] <= edges[0] * lmax) and + (edges[2] >= edges[0] * lmin and edges[2] <= edges[0]* lmax) and + (edges[3] >= edges[0] * eqmin and edges[3] <= edges[0] * eqmax)): return 'f' else: return 'U' |