From 2f2fd36713c2c02f56093338e8c1f3cd7b8d403a Mon Sep 17 00:00:00 2001 From: Takeo Takahashi Date: Thu, 23 Jun 2022 22:28:35 +0900 Subject: [PATCH] tests/renesas-ra: Update pin test to support all boards. Signed-off-by: Takeo Takahashi --- tests/renesas-ra/pin.py | 48 ++++++++----------------------------- tests/renesas-ra/pin.py.exp | 12 ++-------- 2 files changed, 12 insertions(+), 48 deletions(-) diff --git a/tests/renesas-ra/pin.py b/tests/renesas-ra/pin.py index 61d76cca7c..4617cce111 100644 --- a/tests/renesas-ra/pin.py +++ b/tests/renesas-ra/pin.py @@ -1,43 +1,15 @@ from machine import Pin -import os -n = os.uname().machine -if "RA4W1_EK" in n: - try_pin = "P004" - try_s = "Pin(Pin.cpu.P004, mode=Pin.IN, pull=Pin.PULL_NONE, drive=Pin.LOW_POWER)" +p = Pin("SW1", Pin.IN) +if p.value() == 1: + print("pass") else: - try_pin = "P000" - try_s = "Pin(Pin.cpu.P000, mode=Pin.IN, pull=Pin.PULL_NONE, drive=Pin.LOW_POWER)" + print("FAIL") -p = Pin(try_pin, Pin.IN) -if str(p) == try_s: - print("OK") -else: - print("NG") - print("exp: " + try_s) - print("out: " + str(p)) - -p.init(p.IN, p.PULL_UP) -p.init(p.IN, pull=p.PULL_UP) -p.init(mode=p.IN, pull=p.PULL_UP) -print(p.value()) - -p.init(p.OUT) -p.init(p.OPEN_DRAIN) -p.low() -print(p.value()) +p = Pin("LED1", Pin.OUT) p.high() -print(p.value()) -p.value(0) -print(p.value()) -p.value(1) -print(p.value()) -p.value(False) -print(p.value()) -p.value(True) -print(p.value()) -p.off() -print(p.value()) -p.on() -print(p.value()) -p.off() +if p.value() == 1: + print("pass") +else: + print("FAIL") +p.low() diff --git a/tests/renesas-ra/pin.py.exp b/tests/renesas-ra/pin.py.exp index 4c8cc50b0c..0c34cd7a39 100644 --- a/tests/renesas-ra/pin.py.exp +++ b/tests/renesas-ra/pin.py.exp @@ -1,10 +1,2 @@ -OK -1 -0 -1 -0 -1 -0 -1 -0 -1 +pass +pass