Skip to content

Commit d441788

Browse files
committed
esp8266/main: Use new cstack API and add a stack margin of 64 bytes.
The margin of 64 bytes is needed to get `micropython/extreme_exc.py` to pass when run via-mpy. Signed-off-by: Damien George <damien@micropython.org>
1 parent e453d9d commit d441788

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

ports/esp8266/main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "py/builtin.h"
3232
#include "py/compile.h"
3333
#include "py/runtime.h"
34-
#include "py/stackctrl.h"
3534
#include "py/mperrno.h"
3635
#include "py/mphal.h"
3736
#include "py/gc.h"
@@ -108,8 +107,7 @@ static void print_reset_info(void) {
108107
#endif
109108

110109
static void mp_reset(void) {
111-
mp_stack_set_top((void *)0x40000000);
112-
mp_stack_set_limit(8192);
110+
mp_cstack_init_with_top((void *)0x40000000, 8192);
113111
mp_hal_init();
114112
gc_init(heap, heap + sizeof(heap));
115113
mp_init();

ports/esp8266/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#define MICROPY_ALLOC_PARSE_CHUNK_INIT (64)
5353
#define MICROPY_DEBUG_PRINTER (&mp_debug_print)
5454
#define MICROPY_ENABLE_GC (1)
55+
#define MICROPY_STACK_CHECK_MARGIN (64)
5556
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
5657
#define MICROPY_REPL_EVENT_DRIVEN (0)
5758
#define MICROPY_USE_INTERNAL_ERRNO (1)

0 commit comments

Comments
 (0)