diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2019-12-30 12:26:19 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2019-12-30 12:50:07 +0100 |
commit | f34113a300f2866a9eae08678cdb87d8d29a8b88 (patch) | |
tree | 4120658c098a88b3e1696514fcc7523c72d1e9ae /decoders/uart | |
parent | b2ddb8ee4e3883ceabb9a612809b5d3561ab7181 (diff) | |
download | libsigrokdecode-f34113a300f2866a9eae08678cdb87d8d29a8b88.tar.gz libsigrokdecode-f34113a300f2866a9eae08678cdb87d8d29a8b88.zip |
uart: Use human-readable names for binary classes.
Diffstat (limited to 'decoders/uart')
-rw-r--r-- | decoders/uart/pd.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py index 2bae0dc..0109425 100644 --- a/decoders/uart/pd.py +++ b/decoders/uart/pd.py @@ -88,6 +88,9 @@ class Ann: RX_DATA_BIT, TX_DATA_BIT, RX_BREAK, TX_BREAK, RX_PACKET, TX_PACKET = \ range(18) +class Bin: + RX, TX, RXTX = range(3) + class Decoder(srd.Decoder): api_version = 3 id = 'uart' @@ -329,8 +332,8 @@ class Decoder(srd.Decoder): self.putx(rxtx, [rxtx, [formatted]]) bdata = b.to_bytes(self.bw, byteorder='big') - self.putbin(rxtx, [rxtx, bdata]) - self.putbin(rxtx, [2, bdata]) + self.putbin(rxtx, [Bin.RX + rxtx, bdata]) + self.putbin(rxtx, [Bin.RXTX, bdata]) self.handle_packet(rxtx) |