10000 Merge pull request #3006 from sommersoft/update_cpboard_py · jensechu/circuitpython@6ff7e25 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ff7e25

Browse files
authored
Merge pull request adafruit#3006 from sommersoft/update_cpboard_py
Fix Backwards Logic of 'wait_for_response' In adafruit#3005
2 parents 3cf96a5 + 1e7ff52 commit 6ff7e25

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/cpboard.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def reset(self):
127127
self.write(b"\r" + REPL.CHAR_CTRL_B) # enter or reset friendly repl
128128
data = self.read_until(b">>> ")
129129

130-
def execute(self, code, timeout=10, wait_for_response=False):
130+
def execute(self, code, timeout=10, wait_for_response=True):
131131
self.read() # Throw away
132132

133133
self.write(REPL.CHAR_CTRL_A)
@@ -136,7 +136,7 @@ def execute(self, code, timeout=10, wait_for_response=False):
136136
self.write(code)
137137

138138
self.write(REPL.CHAR_CTRL_D)
139-
if wait_for_response:
139+
if not wait_for_response:
140140
return b"", b""
141141
self.read_until(b"OK")
142142

@@ -450,7 +450,7 @@ def close(self):
450450
self.serial.close()
451451
self.serial = None
452452

453-
def exec(self, command, timeout=10, wait_for_response=False):
453+
def exec(self, command, timeout=10, wait_for_response=True):
454454
with self.repl as repl:
455455
try:
456456
output, error = repl.execute(
@@ -483,7 +483,7 @@ def _reset(self, mode="NORMAL"):
483483
)
484484
try:
485485
self.exec(
486-
"import microcontroller;microcontroller.reset()", wait_for_response=True
486+
"import microcontroller;microcontroller.reset()", wait_for_response=False
487487
)
488488
except OSError:
489489
pass

0 commit comments

Comments
 (0)
0