@@ -118,7 +118,7 @@ def reset(self):
118
118
self .write (b'\r ' + REPL .CHAR_CTRL_B ) # enter or reset friendly repl
119
119
data = self .read_until (b'>>> ' )
120
120
121
- def execute (self , code , timeout = 10 , async = False ):
121
+ def execute (self , code , timeout = 10 , wait_for_response = False ):
122
122
self .read () # Throw away
123
123
124
124
self .write (REPL .CHAR_CTRL_A )
@@ -127,7 +127,7 @@ def execute(self, code, timeout=10, async=False):
127
127
self .write (code )
128
128
129
129
self .write (REPL .CHAR_CTRL_D )
130
- if async :
130
+ if wait_for_response :
131
131
return b'' , b''
132
132
self .read_until (b'OK' )
133
133
@@ -424,10 +424,11 @@ def close(self):
424
424
self .serial .close ()
425
425
self .serial = None
426
426
427
- def exec (self , command , timeout = 10 , async = False ):
427
+ def exec (self , command , timeout = 10 , wait_for_response = False ):
428
428
with self .repl as repl :
429
429
try :
430
- output , error = repl .execute (command , timeout = timeout , async = async )
430
+ output , error = repl .execute (command , timeout = timeout ,
431
+ wait_for_response = wait_for_response )
431
432
except OSError as e :
432
433
if self .debug :
433
434
print ('exec: session: ' , self .repl .session )
@@ -451,7 +452,8 @@ def eval(self, expression, timeout=10):
451
452
def _reset (self , mode = 'NORMAL' ):
452
453
self .exec ("import microcontroller;microcontroller.on_next_reset(microcontroller.RunMode.%s)" % mode )
453
454
try :
454
- self .exec ("import microcontroller;microcontroller.reset()" , async = True )
455
+ self .exec ("import microcontroller;microcontroller.reset()" ,
456
+ wait_for_response = True )
455
457
except OSError :
456
458
pass
457
459
0 commit comments