From b9e44d1e0964f5c6c99ec52b68a5a6e0bc1ac633 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 1 Feb 2012 18:59:18 +0100 Subject: srd: uart: Use strings for packet types. While this has a (small) performance penalty compared to using integers, it has the advantage of not requiring the use of magic numbers which need to be declared in both the UART decoder and all decoders which stack on top of UART. --- decoders/pan1321/pan1321.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'decoders/pan1321/pan1321.py') diff --git a/decoders/pan1321/pan1321.py b/decoders/pan1321/pan1321.py index 9c22637..e89b6a0 100644 --- a/decoders/pan1321/pan1321.py +++ b/decoders/pan1321/pan1321.py @@ -29,9 +29,6 @@ import sigrokdecode as srd # Annotation feed formats ANN_ASCII = 0 -# UART 'data' packet type. -T_DATA = 1 - # ... RX = 0 TX = 1 @@ -97,7 +94,7 @@ class Decoder(srd.Decoder): ptype, rxtx, pdata = data # For now, ignore all UART packets except the actual data packets. - if ptype != T_DATA: + if ptype != 'DATA': return # Append a new (ASCII) byte to the currently built/parsed command. -- cgit v1.2.3-70-g09d2