diff options
-rwxr-xr-x | stmhal/autoflash | 3 | ||||
-rw-r--r-- | tools/pyboard.py | 15 |
2 files changed, 10 insertions, 8 deletions
diff --git a/stmhal/autoflash b/stmhal/autoflash index dc28a97e29..d2240ccb55 100755 --- a/stmhal/autoflash +++ b/stmhal/autoflash @@ -8,6 +8,7 @@ # - run a terminal SERIAL=/dev/ttyACM0 +DEVICE=0483:df11 while true; do echo "waiting for DFU device..." @@ -19,7 +20,7 @@ while true; do done echo "found DFU device, flashing" - dfu-util -a 0 -D build/flash.dfu + dfu-util -a 0 -d $DEVICE -D build/flash.dfu echo "waiting for DFU to exit..." while true; do diff --git a/tools/pyboard.py b/tools/pyboard.py index a44710914e..2f77ba37ca 100644 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -110,18 +110,19 @@ def run_test(): pyb.exec('def apply(l, f):\r\n for item in l:\r\n f(item)\r\n') - pyb.exec('leds=[pyb.Led(l) for l in range(1, 5)]') + pyb.exec('leds=[pyb.LED(l) for l in range(1, 5)]') pyb.exec('apply(leds, lambda l:l.off())') ## USR switch test - if True: - for i in range(2): - print("press USR button") - pyb.exec('while pyb.switch(): pyb.delay(10)') - pyb.exec('while not pyb.switch(): pyb.delay(10)') + pyb.exec('switch = pyb.Switch()') + + for i in range(2): + print("press USR button") + pyb.exec('while switch(): pyb.delay(10)') + pyb.exec('while not switch(): pyb.delay(10)') - print('USR switch passed') + print('USR switch passed') ## accel test |