diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2014-01-30 15:26:06 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2014-01-30 15:34:38 +0100 |
commit | e0a0123d2f7f1039fe52f24591dff262b4f8935c (patch) | |
tree | 8f0c346fe483a074892dc010f5bb86fac8635ad7 /decoders/uart | |
parent | 251d5c4f25ef1fae437c67b953221606a9109b77 (diff) | |
download | libsigrokdecode-e0a0123d2f7f1039fe52f24591dff262b4f8935c.tar.gz libsigrokdecode-e0a0123d2f7f1039fe52f24591dff262b4f8935c.zip |
uart: Better fix for ASCII output.
This is a temporary thing, later there'll be some facility to let
frontends handle any annotations marked as "this is a number" (as opposed
to "this is a string") in a generic manner and display them in any
supported (by that frontend) format, e.g. ascii, hex, oct, decimal,
binary, big-endian vs. little-endian, and so on.
This is a fix related to #201.
Diffstat (limited to 'decoders/uart')
-rw-r--r-- | decoders/uart/pd.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py index f1c8323..00be94b 100644 --- a/decoders/uart/pd.py +++ b/decoders/uart/pd.py @@ -230,7 +230,7 @@ class Decoder(srd.Decoder): b, f = self.databyte[rxtx], self.options['format'] if f == 'ascii': - c = chr(b) if chr(b).isprintable() else '[%02X]' % b + c = chr(b) if b in range(30, 126 + 1) else '[%02X]' % b self.putx(rxtx, [rxtx, [c]]) elif f == 'dec': self.putx(rxtx, [rxtx, [str(b)]]) |