From b42bb911c663dc90575d6a7fe3ea4760b6559372 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 11 Oct 2024 13:40:35 +1100 Subject: [PATCH] tests/ports/rp2: Update lightsleep/machine_idle to skip on RP2350. Signed-off-by: Damien George --- tests/ports/rp2/rp2_lightsleep.py | 9 +++++++-- tests/ports/rp2/rp2_machine_idle.py | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/ports/rp2/rp2_lightsleep.py b/tests/ports/rp2/rp2_lightsleep.py index 3587def68..5ce5696e0 100644 --- a/tests/ports/rp2/rp2_lightsleep.py +++ b/tests/ports/rp2/rp2_lightsleep.py @@ -9,13 +9,18 @@ # A range of sleep periods (1 to 512ms) are tested. The total nominal sleep time # is 10.23 seconds, but on most ports this will finish much earlier as interrupts # happen before each timeout expires. +import sys + try: from machine import lightsleep, Pin except ImportError: print("SKIP") raise SystemExit -from sys import stdout, platform +# RP2350 currently fails this test, needs further investigation. +if "RP2350" in sys.implementation._machine: + print("SKIP") + raise SystemExit try: led = Pin(Pin.board.LED, Pin.OUT) @@ -25,7 +30,7 @@ except AttributeError: for n in range(100): if led: led.toggle() - stdout.write(chr(ord("a") + (n % 26))) + sys.stdout.write(chr(ord("a") + (n % 26))) lightsleep(2 ** (n % 10)) print("\nDONE") diff --git a/tests/ports/rp2/rp2_machine_idle.py b/tests/ports/rp2/rp2_machine_idle.py index f9c282847..3135110b8 100644 --- a/tests/ports/rp2/rp2_machine_idle.py +++ b/tests/ports/rp2/rp2_machine_idle.py @@ -1,3 +1,4 @@ +import sys import machine import time @@ -17,6 +18,11 @@ import time # Verification uses the average idle time, as individual iterations will always # have outliers due to interrupts, scheduler, etc. +# RP2350 currently fails this test because machine.idle() resumes immediately. +if "RP2350" in sys.implementation._machine: + print("SKIP") + raise SystemExit + ITERATIONS = 500 total = 0