diff --git a/ports/teensy/Makefile b/ports/teensy/Makefile index d3978718e0..cf9529442a 100644 --- a/ports/teensy/Makefile +++ b/ports/teensy/Makefile @@ -95,7 +95,6 @@ SRC_C = \ usb.c \ STM_SRC_C = $(addprefix ports/stm32/,\ - gccollect.c \ irq.c \ pin.c \ pin_named_pins.c \ diff --git a/ports/teensy/main.c b/ports/teensy/main.c index df3fd1ffcf..d4c5f0396f 100644 --- a/ports/teensy/main.c +++ b/ports/teensy/main.c @@ -9,6 +9,7 @@ #include "py/gc.h" #include "py/mphal.h" #include "gccollect.h" +#include "lib/utils/gchelper.h" #include "lib/utils/pyexec.h" #include "lib/mp-readline/readline.h" #include "lexermemzip.h" @@ -349,6 +350,12 @@ int main(void) { goto soft_reset; } +void gc_collect(void) { + gc_collect_start(); + gc_helper_collect_regs_and_stack(); + gc_collect_end(); +} + // stub out __libc_init_array. It's called by mk20dx128.c and is used to call // global C++ constructors. Since this is a C-only projects, we don't need to // call constructors.