Make pyboard.enter_raw_repl more robust

In case there's a program in the microcontroller's main.py running in an infinite loop
This commit is contained in:
Andrew Scheller 2014-05-01 20:42:23 +01:00
parent 1f85d6255d
commit 1f740bdaf4
1 changed files with 1 additions and 0 deletions

View File

@ -50,6 +50,7 @@ class Pyboard:
return data return data
def enter_raw_repl(self): def enter_raw_repl(self):
self.serial.write(b'\r\x03') # ctrl-C: interrupt any running program
self.serial.write(b'\r\x01') # ctrl-A: enter raw REPL self.serial.write(b'\r\x01') # ctrl-A: enter raw REPL
self.serial.write(b'\x04') # ctrl-D: soft reset self.serial.write(b'\x04') # ctrl-D: soft reset
data = self.read_until(1, b'to exit\r\n>') data = self.read_until(1, b'to exit\r\n>')