8000 Merge pull request #547 from cjbarnes18/pyboard_module_fixes · hellcoderz/micropython@d9f4dee · GitHub
[go: up one dir, main page]

Skip to content

Commit d9f4dee

Browse files
committed
Merge pull request micropython#547 from cjbarnes18/pyboard_module_fixes
Fix pyboard.py tests.
2 parents b37c0a1 + 71a1e35 commit d9f4dee

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tools/pyboard.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,19 @@ def run_test():
110110

111111
pyb.exec('def apply(l, f):\r\n for item in l:\r\n f(item)\r\n')
112112

113-
pyb.exec('leds=[pyb.Led(l) for l in range(1, 5)]')
113+
pyb.exec('leds=[pyb.LED(l) for l in range(1, 5)]')
114114
pyb.exec('apply(leds, lambda l:l.off())')
115115

116116
## USR switch test
117117

118-
if True:
119-
for i in range(2):
120-
print("press USR button")
121-
pyb.exec('while pyb.switch(): pyb.delay(10)')
122-
pyb.exec('while not pyb.switch(): pyb.delay(10)')
118+
pyb.exec('switch = pyb.Switch()')
119+
120+
for i in range(2):
121+
print("press USR button")
122+
pyb.exec('while switch(): pyb.delay(10)')
123+
pyb.exec('while not switch(): pyb.delay(10)')
123124

124-
print('USR switch passed')
125+
print('USR switch passed')
125126

126127
## accel test
127128

0 commit comments

Comments
 (0)
0