Skip to content

Commit

Permalink
tests/ports/rp2: Update lightsleep/machine_idle to skip on RP2350.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Oct 15, 2024
1 parent 651b63c commit b42bb91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/ports/rp2/rp2_lightsleep.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -25,7 +30,7 @@
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")
6 changes: 6 additions & 0 deletions tests/ports/rp2/rp2_machine_idle.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import machine
import time

Expand All @@ -17,6 +18,11 @@
# 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

Expand Down

0 comments on commit b42bb91

Please sign in to comment.