@@ -127,7 +127,7 @@ def reset(self):
127
127
self .write (b"\r " + REPL .CHAR_CTRL_B ) # enter or reset friendly repl
128
128
data = self .read_until (b">>> " )
129
129
130
- def execute (self , code , timeout = 10 , wait_for_response = False ):
130
+ def execute (self , code , timeout = 10 , wait_for_response = True ):
131
131
self .read () # Throw away
132
132
133
133
self .write (REPL .CHAR_CTRL_A )
@@ -136,7 +136,7 @@ def execute(self, code, timeout=10, wait_for_response=False):
136
136
self .write (code )
137
137
138
138
self .write (REPL .CHAR_CTRL_D )
139
- if wait_for_response :
139
+ if not wait_for_response :
140
140
return b"" , b""
141
141
self .read_until (b"OK" )
142
142
@@ -450,7 +450,7 @@ def close(self):
450
450
self .serial .close ()
451
451
self .serial = None
452
452
453
- def exec (self , command , timeout = 10 , wait_for_response = False ):
453
+ def exec (self , command , timeout = 10 , wait_for_response = True ):
454
454
with self .repl as repl :
455
455
try :
456
456
output , error = repl .execute (
@@ -483,7 +483,7 @@ def _reset(self, mode="NORMAL"):
483
483
)
484
484
try :
485
485
self .exec (
486
- "import microcontroller;microcontroller.reset()" , wait_for_response = True
486
+ "import microcontroller;microcontroller.reset()" , wait_for_response = False
487
487
)
488
488
except OSError :
489
489
pass
0 commit comments