From: Uwe Hermann Date: Mon, 30 Dec 2019 11:26:19 +0000 (+0100) Subject: uart: Use human-readable names for binary classes. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f34113a300f2866a9eae08678cdb87d8d29a8b88;p=libsigrokdecode.git uart: Use human-readable names for binary classes. --- 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)