summaryrefslogtreecommitdiff
path: root/decoders/uart
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2019-12-30 12:26:19 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2019-12-30 12:50:07 +0100
commitf34113a300f2866a9eae08678cdb87d8d29a8b88 (patch)
tree4120658c098a88b3e1696514fcc7523c72d1e9ae /decoders/uart
parentb2ddb8ee4e3883ceabb9a612809b5d3561ab7181 (diff)
downloadlibsigrokdecode-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.py7
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)