summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorGeorge Hopkins <george-hopkins@null.net>2017-11-30 15:58:05 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2018-05-03 16:08:07 +0200
commita3ac52d1beb462d66719705602c0cb54842f0682 (patch)
tree97a9b26eff40c4b8df4e3858abd02efe04540771 /decoders
parentbf1eeb932f319b3984580e5d47ecb65ff9a62020 (diff)
downloadlibsigrokdecode-a3ac52d1beb462d66719705602c0cb54842f0682.tar.gz
libsigrokdecode-a3ac52d1beb462d66719705602c0cb54842f0682.zip
jtag_stm32: Always switch state on new instruction
Diffstat (limited to 'decoders')
-rw-r--r--decoders/jtag_stm32/pd.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/decoders/jtag_stm32/pd.py b/decoders/jtag_stm32/pd.py
index 4cd58bb..593ce13 100644
--- a/decoders/jtag_stm32/pd.py
+++ b/decoders/jtag_stm32/pd.py
@@ -232,11 +232,7 @@ class Decoder(srd.Decoder):
val, self.samplenums = val
self.samplenums.reverse()
- # State machine
- if self.state == 'IDLE':
- # Wait until a new instruction is shifted into the IR register.
- if cmd != 'IR TDI':
- return
+ if cmd == 'IR TDI':
# Switch to the state named after the instruction, or 'UNKNOWN'.
# The STM32F10xxx has two serially connected JTAG TAPs, the
# boundary scan tap (5 bits) and the Cortex-M3 TAP (4 bits).
@@ -246,7 +242,9 @@ class Decoder(srd.Decoder):
self.putf(4, 8, [1, ['IR (BS TAP): ' + bstap_ir]])
self.putf(0, 3, [1, ['IR (M3 TAP): ' + self.state]])
self.putx([2, ['IR: %s' % self.state]])
- elif self.state == 'BYPASS':
+
+ # State machine
+ if self.state == 'BYPASS':
# Here we're interested in incoming bits (TDI).
if cmd != 'DR TDI':
return