diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2018-06-21 21:49:14 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2018-06-22 12:10:52 +0200 |
commit | 392a5d1ef4bb356be248589dad28d0bd83411c49 (patch) | |
tree | 1b2535865e44eed059f583d40c2809bbf012a566 /decoders/common/srdhelper | |
parent | aaaf37e1229ca414d4e077b3ce9d05cfd7b19e7f (diff) | |
download | libsigrokdecode-392a5d1ef4bb356be248589dad28d0bd83411c49.tar.gz libsigrokdecode-392a5d1ef4bb356be248589dad28d0bd83411c49.zip |
jtag_ejtag: Move bin2int() to common/srdhelper.
Also, rename from bin_to_int to bin2int() for consistency.
Diffstat (limited to 'decoders/common/srdhelper')
-rw-r--r-- | decoders/common/srdhelper/mod.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/decoders/common/srdhelper/mod.py b/decoders/common/srdhelper/mod.py index b559c95..3c495b4 100644 --- a/decoders/common/srdhelper/mod.py +++ b/decoders/common/srdhelper/mod.py @@ -21,6 +21,9 @@ def bcd2int(b): return (b & 0x0f) + ((b >> 4) * 10) +def bin2int(s: str): + return int('0b' + s, 2) + def bitpack(bits): res = 0 for i, b in enumerate(bits): |