Skip to content

Commit

Permalink
teensy: Provide own implementation of gc_collect, to not use stm32.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge authored and pfalcon committed Jun 8, 2021
1 parent 75fa5aa commit 0dd3207
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion ports/teensy/Makefile
Expand Up @@ -95,7 +95,6 @@ SRC_C = \
usb.c \

STM_SRC_C = $(addprefix ports/stm32/,\
gccollect.c \
irq.c \
pin.c \
pin_named_pins.c \
Expand Down
7 changes: 7 additions & 0 deletions ports/teensy/main.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0dd3207

Please sign in to comment.