Skip to content
Snippets Groups Projects
Commit f20b625a authored by schneider's avatar schneider
Browse files

fix(pycard10): Reliably trigger soft reset and enter raw REPL

parent 56b73d41
No related branches found
No related tags found
No related merge requests found
...@@ -129,6 +129,9 @@ class PyCard10(Pyboard): ...@@ -129,6 +129,9 @@ class PyCard10(Pyboard):
Returns: Returns:
None None
""" """
self.soft_reset()
self.serial.write(b"\x03\x03") # ctrl-C twice: interrupt any running program self.serial.write(b"\x03\x03") # ctrl-C twice: interrupt any running program
# flush input (without relying on serial.flushInput()) # flush input (without relying on serial.flushInput())
...@@ -169,10 +172,12 @@ class PyCard10(Pyboard): ...@@ -169,10 +172,12 @@ class PyCard10(Pyboard):
self.serial.write(b"\x03\x03") # ctrl-C twice: interrupt any running program self.serial.write(b"\x03\x03") # ctrl-C twice: interrupt any running program
self.serial.write(b"\x01") # ctrl-B: ensue it's the normal mode self.serial.write(b"\x02") # ctrl-B: ensue it's the normal mode
self.serial.write(b"\x04") # ctrl-D: do the reset self.serial.write(b"\x04") # ctrl-D: do the reset
time.sleep(1) # Give epicardium some time to cycle pycardium
n = self.serial.inWaiting() n = self.serial.inWaiting()
while n > 0: while n > 0:
self.serial.read(n) self.serial.read(n)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment