summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorStefan Brüns <stefan.bruens@rwth-aachen.de>2017-07-22 20:17:10 +0200
committerStefan Brüns <stefan.bruens@rwth-aachen.de>2017-07-22 20:17:10 +0200
commitb677e536891fc19d949217023df622e30531220c (patch)
tree51add0b80da769fb37894dc0ebfce61bd3e63c00 /decoders
parentfc9d619c520c2b47b52ff71e30260ed9333f33f2 (diff)
downloadlibsigrokdecode-b677e536891fc19d949217023df622e30531220c.tar.gz
libsigrokdecode-b677e536891fc19d949217023df622e30531220c.zip
usb_request: Remove code duplication, save end sample in central location
Diffstat (limited to 'decoders')
-rw-r--r--decoders/usb_request/pd.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/decoders/usb_request/pd.py b/decoders/usb_request/pd.py
index 76e015b..1bd2878 100644
--- a/decoders/usb_request/pd.py
+++ b/decoders/usb_request/pd.py
@@ -196,18 +196,17 @@ class Decoder(srd.Decoder):
request = self.request[(addr,ep)]
if request_end:
+ request['es'] = self.es_transaction
request['handshake'] = self.handshake
# BULK or INTERRUPT transfer
if request['type'] in (None, 'BULK IN') and self.transaction_type == 'IN':
request['type'] = 'BULK IN'
request['data'] += self.transaction_data
- request['es'] = self.es_transaction
self.handle_request(request_started, request_end)
elif request['type'] in (None, 'BULK OUT') and self.transaction_type == 'OUT':
request['type'] = 'BULK OUT'
request['data'] += self.transaction_data
- request['es'] = self.es_transaction
self.handle_request(request_started, request_end)
# CONTROL, SETUP stage
@@ -233,11 +232,9 @@ class Decoder(srd.Decoder):
# CONTROL, STATUS stage
elif request['type'] == 'SETUP IN' and self.transaction_type == 'OUT':
- request['es'] = self.es_transaction
self.handle_request(0, request_end)
elif request['type'] == 'SETUP OUT' and self.transaction_type == 'IN':
- request['es'] = self.es_transaction
self.handle_request(0, request_end)
else: