summaryrefslogtreecommitdiffstatshomepage
path: root/tools/pyboard.py
diff options
context:
space:
mode:
authorblmorris <bryan.morrissey@gmail.com>2014-10-01 13:53:50 -0400
committerDamien George <damien.p.george@gmail.com>2014-10-01 23:31:52 +0100
commit3b064370f83891a25f1fb786f079cd0e0383903e (patch)
tree1afbc8b9f8d42df7fef486ee556ec3c1b4133f68 /tools/pyboard.py
parent762d57519d2e7bdd249ad2aa2087943993e694ac (diff)
downloadmicropython-3b064370f83891a25f1fb786f079cd0e0383903e.tar.gz
micropython-3b064370f83891a25f1fb786f079cd0e0383903e.zip
Enable device keyword option when running pyboard.py --tests and run-tests --pyboard
Diffstat (limited to 'tools/pyboard.py')
-rw-r--r--tools/pyboard.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py
index dce60350d0..f7bd92b262 100644
--- a/tools/pyboard.py
+++ b/tools/pyboard.py
@@ -105,12 +105,12 @@ def execfile(filename, device='/dev/ttyACM0'):
pyb.exit_raw_repl()
pyb.close()
-def run_test():
- device = '/dev/ttyACM0'
+def run_test(device):
pyb = Pyboard(device)
pyb.enter_raw_repl()
print('opened device {}'.format(device))
+ pyb.exec('import pyb') # module pyb no longer imported by default, required for pyboard tests
print('seconds since boot:', pyb.get_time())
pyb.exec('def apply(l, f):\r\n for item in l:\r\n f(item)\r\n')
@@ -170,7 +170,7 @@ def main():
args = cmd_parser.parse_args()
if args.test:
- run_test()
+ run_test(device=args.device)
for file in args.files:
execfile(file, device=args.device)