core: enable PYSTACK

pull/1128/head
matejcik 4 years ago committed by Tomas Susanka
parent d568afa80d
commit f723dca7b1

@ -282,6 +282,7 @@ SOURCE_MICROPYTHON = [
SOURCE_MICROPYTHON_SPEED = [
'vendor/micropython/py/gc.c',
'vendor/micropython/py/pystack.c',
'vendor/micropython/py/vm.c',
]

@ -97,6 +97,11 @@ int main(void) {
mp_stack_set_top(&_estack);
mp_stack_set_limit((char *)&_estack - (char *)&_heap_end - 1024);
#if MICROPY_ENABLE_PYSTACK
static mp_obj_t pystack[1024];
mp_pystack_init(pystack, &pystack[MP_ARRAY_SIZE(pystack)]);
#endif
// GC init
printf("CORE: Starting GC\n");
gc_init(&_heap_start, &_heap_end);

@ -39,6 +39,7 @@
// memory allocation policies
#define MICROPY_ALLOC_PATH_MAX (128)
#define MICROPY_ENABLE_PYSTACK (1)
// emitters
#define MICROPY_PERSISTENT_CODE_LOAD (0)

@ -468,6 +468,11 @@ MP_NOINLINE int main_(int argc, char **argv) {
gc_init(heap, heap + heap_size);
#endif
#if MICROPY_ENABLE_PYSTACK
static mp_obj_t pystack[1024];
mp_pystack_init(pystack, &pystack[MP_ARRAY_SIZE(pystack)]);
#endif
mp_init();
char *home = getenv("HOME");

@ -44,6 +44,7 @@
#define MICROPY_ALLOC_PATH_MAX (PATH_MAX)
#define MICROPY_MALLOC_USES_ALLOCATED_SIZE (1)
#define MICROPY_MEM_STATS (1)
#define MICROPY_ENABLE_PYSTACK (1)
// emitters
#define MICROPY_PERSISTENT_CODE_LOAD (0)

Loading…
Cancel
Save