From 6dc817ed476a6decb00d8b85f7f5c7a3efa84118 Mon Sep 17 00:00:00 2001 From: enriquezgarc Date: Thu, 13 Jul 2023 16:39:13 +0200 Subject: [PATCH 1/2] ports/psoc6/modules/machine/machine_timer.c: Removed print in isr. Signed-off-by: enriquezgarc --- ports/psoc6/modules/machine/machine_timer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/psoc6/modules/machine/machine_timer.c b/ports/psoc6/modules/machine/machine_timer.c index 94b927178590..d5d87a31021e 100644 --- a/ports/psoc6/modules/machine/machine_timer.c +++ b/ports/psoc6/modules/machine/machine_timer.c @@ -23,7 +23,6 @@ typedef struct _machine_timer_obj_t { const mp_obj_type_t machine_timer_type; static void isr_timer(void *callback_arg, cyhal_timer_event_t event) { - mp_printf(&mp_plat_print, "Here isr"); machine_timer_obj_t *self = callback_arg; mp_sched_schedule(self->callback, MP_OBJ_FROM_PTR(self)); } From 5a077c6c9f021b9fccae09394fdb5c08a7ec4261 Mon Sep 17 00:00:00 2001 From: enriquezgarc Date: Thu, 13 Jul 2023 16:40:30 +0200 Subject: [PATCH 2/2] test/psoc6/timer.py: Added basic timer test. Signed-off-by: enriquezgarc --- tests/psoc6/timer.py | 6 ++++++ tests/psoc6/timer.py.exp | 1 + 2 files changed, 7 insertions(+) create mode 100644 tests/psoc6/timer.py create mode 100644 tests/psoc6/timer.py.exp diff --git a/tests/psoc6/timer.py b/tests/psoc6/timer.py new file mode 100644 index 000000000000..7acef9376b0d --- /dev/null +++ b/tests/psoc6/timer.py @@ -0,0 +1,6 @@ +import time +from machine import Timer + +t = Timer(0) +t.init(period=2000, mode=Timer.ONE_SHOT, callback=lambda t: print("hello")) +time.sleep_ms(3000) diff --git a/tests/psoc6/timer.py.exp b/tests/psoc6/timer.py.exp new file mode 100644 index 000000000000..ce013625030b --- /dev/null +++ b/tests/psoc6/timer.py.exp @@ -0,0 +1 @@ +hello