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
# 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")

View File

@ -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