aboutsummaryrefslogtreecommitdiff
path: root/tests/pybnative
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pybnative')
-rw-r--r--tests/pybnative/for.py4
-rw-r--r--tests/pybnative/while.py2
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/pybnative/for.py b/tests/pybnative/for.py
index 309c6c14f..50177a9ba 100644
--- a/tests/pybnative/for.py
+++ b/tests/pybnative/for.py
@@ -1,15 +1,19 @@
import pyb
+
@micropython.native
def f1(n):
for i in range(n):
print(i)
+
f1(4)
+
@micropython.native
def f2(r):
for i in r:
print(i)
+
f2(range(4))
diff --git a/tests/pybnative/while.py b/tests/pybnative/while.py
index 3ea7221ea..0f397dd37 100644
--- a/tests/pybnative/while.py
+++ b/tests/pybnative/while.py
@@ -1,5 +1,6 @@
import pyb
+
@micropython.native
def f(led, n, d):
led.off()
@@ -11,5 +12,6 @@ def f(led, n, d):
i += 1
led.off()
+
f(pyb.LED(1), 2, 150)
f(pyb.LED(2), 4, 50)