Commit b3a65791 authored by Paul Sokolovsky's avatar Paul Sokolovsky

zephyr: Enable stack checking and micropython.mem_info().

parent ac701197
......@@ -7,6 +7,7 @@
#include "py/runtime.h"
#include "py/repl.h"
#include "py/gc.h"
#include "py/stackctrl.h"
#include "lib/utils/pyexec.h"
void do_str(const char *src, mp_parse_input_kind_t input_kind) {
......@@ -35,6 +36,9 @@ static char heap[16 * 1024];
int real_main(void) {
int stack_dummy;
stack_top = (char*)&stack_dummy;
mp_stack_set_top(stack_top);
// Should be set to stack size in prj.mdef minus fuzz factor
mp_stack_set_limit(3584);
#if MICROPY_ENABLE_GC
gc_init(heap, heap + sizeof(heap));
......
......@@ -5,6 +5,7 @@
#define MICROPY_COMP_CONST (0)
#define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (0)
#define MICROPY_STACK_CHECK (1)
#define MICROPY_ENABLE_GC (1)
#define MICROPY_HELPER_REPL (1)
#define MICROPY_REPL_AUTO_INDENT (1)
......@@ -23,6 +24,7 @@
#define MICROPY_PY_COLLECTIONS (0)
#define MICROPY_PY_CMATH (0)
#define MICROPY_PY_IO (0)
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
#define MICROPY_PY_STRUCT (0)
#define MICROPY_PY_SYS_MODULES (0)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment