summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2015-09-02 20:49:47 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2015-09-03 18:03:53 +0200
commita4dd548f5332453cef7442e453eef99343bdc5fb (patch)
tree21491b33d4a44030b7a4c19daf51a33da7e88241
parent36faa6d0a353709235b7bf1076ae29552154e4a9 (diff)
downloadlibsigrokdecode-a4dd548f5332453cef7442e453eef99343bdc5fb.tar.gz
libsigrokdecode-a4dd548f5332453cef7442e453eef99343bdc5fb.zip
jtag_stm32: Update to reflect change in jtag OUT_PYTHON.
-rw-r--r--decoders/jtag_stm32/pd.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/decoders/jtag_stm32/pd.py b/decoders/jtag_stm32/pd.py
index 51c910d..10a098f 100644
--- a/decoders/jtag_stm32/pd.py
+++ b/decoders/jtag_stm32/pd.py
@@ -133,7 +133,7 @@ class Decoder(srd.Decoder):
def __init__(self, **kwargs):
self.state = 'IDLE'
- # self.state = 'BYPASS'
+ self.samplenums = None
def start(self):
self.out_ann = self.register(srd.OUTPUT_ANN)
@@ -178,16 +178,20 @@ class Decoder(srd.Decoder):
[0, ['Unknown instruction: ' % bits]]) # TODO
def decode(self, ss, es, data):
- # Assumption: The right-most char in the 'val' bitstring is the LSB.
cmd, val = data
self.ss, self.es = ss, es
- # The STM32F10xxx has two serially connected JTAG TAPs, the
- # boundary scan tap (5 bits) and the Cortex-M3 TAP (4 bits).
- # See UM 31.5 "STM32F10xxx JTAG TAP connection" for details.
- # Due to this, we need to ignore the last bit of each data shift.
- val = val[:-1]
+ if cmd != 'NEW STATE':
+ val, self.samplenums = val
+
+ # The right-most char in the 'val' bitstring is the LSB.
+
+ # The STM32F10xxx has two serially connected JTAG TAPs, the
+ # boundary scan tap (5 bits) and the Cortex-M3 TAP (4 bits).
+ # See UM 31.5 "STM32F10xxx JTAG TAP connection" for details.
+ # Due to this, we need to ignore the last bit of each data shift.
+ val = val[:-1]
# State machine
if self.state == 'IDLE':