Skip to content

Commit 2f2fd36

Browse files
TakeoTakahashi2020dpgeorge
authored andcommitted
tests/renesas-ra: Update pin test to support all boards.
Signed-off-by: Takeo Takahashi <[email protected]>
1 parent 621bff8 commit 2f2fd36

File tree

2 files changed

+11
-47
lines changed

2 files changed

+11
-47
lines changed

tests/renesas-ra/pin.py

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,15 @@
11
from machine import Pin
2-
import os
32

4-
n = os.uname().machine
5-
if "RA4W1_EK" in n:
6-
try_pin = "P004"
7-
try_s = "Pin(Pin.cpu.P004, mode=Pin.IN, pull=Pin.PULL_NONE, drive=Pin.LOW_POWER)"
3+
p = Pin("SW1", Pin.IN)
4+
if p.value() == 1:
5+
print("pass")
86
else:
9-
try_pin = "P000"
10-
try_s = "Pin(Pin.cpu.P000, mode=Pin.IN, pull=Pin.PULL_NONE, drive=Pin.LOW_POWER)"
7+
print("FAIL")
118

12-
p = Pin(try_pin, Pin.IN)
13-
if str(p) == try_s:
14-
print("OK")
9+
p = Pin("LED1", Pin.OUT)
10+
p.high()
11+
if p.value() == 1:
12+
print("pass")
1513
else:
16-
print("NG")
17-
print("exp: " + try_s)
18-
print("out: " + str(p))
19-
20-
p.init(p.IN, p.PULL_UP)
21-
p.init(p.IN, pull=p.PULL_UP)
22-
p.init(mode=p.IN, pull=p.PULL_UP)
23-
print(p.value())
24-
25-
p.init(p.OUT)
26-
p.init(p.OPEN_DRAIN)
14+
print("FAIL")
2715
p.low()
28-
print(p.value())
29-
p.high()
30-
print(p.value())
31-
p.value(0)
32-
print(p.value())
33-
p.value(1)
34-
print(p.value())
35-
p.value(False)
36-
print(p.value())
37-
p.value(True)
38-
print(p.value())
39-
p.off()
40-
print(p.value())
41-
p.on()
42-
print(p.value())
43-
p.off()

tests/renesas-ra/pin.py.exp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,2 @@
1-
OK
2-
1
3-
0
4-
1
5-
0
6-
1
7-
0
8-
1
9-
0
10-
1
1+
pass
2+
pass

0 commit comments

Comments
 (0)