Skip to content
Snippets Groups Projects
Commit 260dc5b3 authored by rahix's avatar rahix
Browse files

fix(pycard10): Make pycard10 reset pycardium via os.exec("")


This will result in more reliably reaching a clean state.

Co-Authored-By: default avatarschneider <schneider@muc.ccc.de>
Signed-off-by: default avatarRahix <rahix@rahix.de>
parent a9c9d666
Branches
Tags
1 merge request!417Pycardium Improvements
Pipeline #4786 passed
......@@ -130,10 +130,12 @@ class PyCard10(Pyboard):
None
"""
self.soft_reset()
self.serial.write(b"\x03\x03") # ctrl-C twice: interrupt any running program
self.serial.write(b"\x02") # ctrl-B: ensue it's the normal mode
self.serial.write(b'__import__("os").exec("")\r') # Reset to REPL
# flush input (without relying on serial.flushInput())
n = self.serial.inWaiting()
while n > 0:
......@@ -176,8 +178,6 @@ class PyCard10(Pyboard):
self.serial.write(b"\x04") # ctrl-D: do the reset
time.sleep(1) # Give epicardium some time to cycle pycardium
n = self.serial.inWaiting()
while n > 0:
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