summaryrefslogtreecommitdiff
path: root/tests/pybnative/while.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-05-07 23:27:45 +0100
committerDamien George <damien.p.george@gmail.com>2014-05-07 23:27:45 +0100
commitd509ac25f9f387c5690126c49893d3da142971c2 (patch)
tree73c188e7ae137e28740d28d42cfdcbc939cc4df4 /tests/pybnative/while.py
parentbe6aa53cdb18359e5c7e51caac2ca0ea7160962d (diff)
py: Fix stack access in thumb native emitter.
Diffstat (limited to 'tests/pybnative/while.py')
-rw-r--r--tests/pybnative/while.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/pybnative/while.py b/tests/pybnative/while.py
index a3f64a800..3ea7221ea 100644
--- a/tests/pybnative/while.py
+++ b/tests/pybnative/while.py
@@ -1,14 +1,15 @@
+import pyb
+
@micropython.native
-def f(led, n):
+def f(led, n, d):
led.off()
i = 0
while i < n:
+ print(i)
led.toggle()
- d = pyb.delay
- d(50) # pyb.delay(50) doesn't work!
+ pyb.delay(d)
i += 1
- print(i)
led.off()
-f(pyb.LED(1), 2)
-f(pyb.LED(2), 4)
+f(pyb.LED(1), 2, 150)
+f(pyb.LED(2), 4, 50)