tests/ports/rp2: Update lightsleep/machine_idle to skip on RP2350.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2024-10-11 13:40:35 +11:00
parent 651b63cd79
commit b42bb911c6
2 changed files with 13 additions and 2 deletions

View File

@ -9,13 +9,18 @@
# A range of sleep periods (1 to 512ms) are tested. The total nominal sleep time # 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 # is 10.23 seconds, but on most ports this will finish much earlier as interrupts
# happen before each timeout expires. # happen before each timeout expires.
import sys
try: try:
from machine import lightsleep, Pin from machine import lightsleep, Pin
except ImportError: except ImportError:
print("SKIP") print("SKIP")
raise SystemExit 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: try:
led = Pin(Pin.board.LED, Pin.OUT) led = Pin(Pin.board.LED, Pin.OUT)
@ -25,7 +30,7 @@ except AttributeError:
for n in range(100): for n in range(100):
if led: if led:
led.toggle() led.toggle()
stdout.write(chr(ord("a") + (n % 26))) sys.stdout.write(chr(ord("a") + (n % 26)))
lightsleep(2 ** (n % 10)) lightsleep(2 ** (n % 10))
print("\nDONE") print("\nDONE")

View File

@ -1,3 +1,4 @@
import sys
import machine import machine
import time import time
@ -17,6 +18,11 @@ import time
# Verification uses the average idle time, as individual iterations will always # Verification uses the average idle time, as individual iterations will always
# have outliers due to interrupts, scheduler, etc. # 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 ITERATIONS = 500
total = 0 total = 0