diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2012-02-01 18:59:18 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2012-02-01 23:18:23 +0100 |
commit | b9e44d1e0964f5c6c99ec52b68a5a6e0bc1ac633 (patch) | |
tree | bb63c710d672507bd791b46976ca00216ea51ee6 /decoders/pan1321 | |
parent | b77614bc977475102062ac5d1c8fe8e55349315a (diff) | |
download | libsigrokdecode-b9e44d1e0964f5c6c99ec52b68a5a6e0bc1ac633.tar.gz libsigrokdecode-b9e44d1e0964f5c6c99ec52b68a5a6e0bc1ac633.zip |
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.
Diffstat (limited to 'decoders/pan1321')
-rw-r--r-- | decoders/pan1321/pan1321.py | 5 |
1 files changed, 1 insertions, 4 deletions
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. |