diff --git a/tests/psoc6/flash.py b/tests/psoc6/flash.py index b75771af4e67..7cde88f97ffc 100644 --- a/tests/psoc6/flash.py +++ b/tests/psoc6/flash.py @@ -1,5 +1,11 @@ import os, psoc6 +machine = os.uname().machine +if "CY8CPROTO-063-BLE" in machine: + # TODO: Not working for this board. Neither the timer timing is correct + print("SKIP") + raise SystemExit + # Try to mount the filesystem, and format the flash if it doesn't exist. # create block device object based on whichever flash is active bdev = psoc6.QSPI_Flash() if "QSPI_Flash" in dir(psoc6) else psoc6.Flash() diff --git a/tests/psoc6/timer.py b/tests/psoc6/timer.py index feab256a9267..33f776371ab8 100644 --- a/tests/psoc6/timer.py +++ b/tests/psoc6/timer.py @@ -1,18 +1,26 @@ import time from machine import Timer +import os + +machine = os.uname().machine +if "CY8CPROTO-063-BLE" in machine: + # TODO: Not working for this board. Neither the timer timing is correct + print("SKIP") + raise SystemExit t = Timer(0) t.init(period=2000, mode=Timer.ONE_SHOT, callback=lambda t: print("Oneshot Timer")) time.sleep(3) t.deinit() -# TODO the whole time functionality is not really working... -# def blocking_delay_ms(delay_ms): -# start = time.ticks_ms() -# while time.ticks_diff(time.ticks_ms(), start) < delay_ms: -# pass -# t1 = Timer(0) -# t1.init(period=2000, mode=Timer.PERIODIC, callback=lambda t: print("Periodic Timer")) -# blocking_delay_ms(2000) -# t.deinit() +def blocking_delay_ms(delay_ms): + start = time.ticks_ms() + while time.ticks_diff(time.ticks_ms(), start) < delay_ms: + pass + + +t1 = Timer(0) +t1.init(period=2000, mode=Timer.PERIODIC, callback=lambda t: print("Periodic Timer")) +blocking_delay_ms(2000) +t.deinit()