Skip to content

Commit 69ffc98

Browse files
committed
codal_port: Enable MICROPY_STACK_CHECK to check C stack depth.
1 parent 0e8ae78 commit 69ffc98

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/codal_port/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void microbit_pyexec_file(const char *filename);
4848

4949
void mp_main(void) {
5050
mp_stack_ctrl_init();
51-
mp_stack_set_limit(8 * 1024);
51+
mp_stack_set_limit(8 * 1024 - 512); // include 512 byte buffer zone for overflow
5252

5353
for (;;) {
5454
microbit_system_init();

src/codal_port/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#define MICROPY_VM_HOOK_LOOP MICROPY_VM_HOOK_POLL
4848
#define MICROPY_VM_HOOK_RETURN MICROPY_VM_HOOK_POLL
4949
#define MICROPY_ENABLE_GC (1)
50+
#define MICROPY_STACK_CHECK (1)
5051
#define MICROPY_KBD_EXCEPTION (1)
5152
#define MICROPY_HELPER_REPL (1)
5253
#define MICROPY_REPL_AUTO_INDENT (1)

0 commit comments

Comments
 (0)