summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsommersoft <sommersoft@users.noreply.github.com>2020-06-06 10:52:44 -0500
committerGitHub <noreply@github.com>2020-06-06 10:52:44 -0500
commit6ff7e25397bcbf633b938f60769c274b05156251 (patch)
tree40aab855ffe084d699add15b8f0b2ac12d69ca3e
parent3cf96a554df1a5b473650c3230861d44bafa6d9f (diff)
parent1e7ff52bb738e02695b1b87f8e4644152a576508 (diff)
Merge pull request #3006 from sommersoft/update_cpboard_py
Fix Backwards Logic of 'wait_for_response' In #3005
-rw-r--r--tools/cpboard.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/cpboard.py b/tools/cpboard.py
index e5a29ab25..7769cb4f4 100644
--- a/tools/cpboard.py
+++ b/tools/cpboard.py
@@ -127,7 +127,7 @@ class REPL:
self.write(b"\r" + REPL.CHAR_CTRL_B) # enter or reset friendly repl
data = self.read_until(b">>> ")
- def execute(self, code, timeout=10, wait_for_response=False):
+ def execute(self, code, timeout=10, wait_for_response=True):
self.read() # Throw away
self.write(REPL.CHAR_CTRL_A)
@@ -136,7 +136,7 @@ class REPL:
self.write(code)
self.write(REPL.CHAR_CTRL_D)
- if wait_for_response:
+ if not wait_for_response:
return b"", b""
self.read_until(b"OK")
@@ -450,7 +450,7 @@ class CPboard:
self.serial.close()
self.serial = None
- def exec(self, command, timeout=10, wait_for_response=False):
+ def exec(self, command, timeout=10, wait_for_response=True):
with self.repl as repl:
try:
output, error = repl.execute(
@@ -483,7 +483,7 @@ class CPboard:
)
try:
self.exec(
- "import microcontroller;microcontroller.reset()", wait_for_response=True
+ "import microcontroller;microcontroller.reset()", wait_for_response=False
)
except OSError:
pass