esp8266: Use dedicated heap allocated as static array.

We cannot assume that all memory belongs to us - it actually belongs to
ESP8266 OS.
This commit is contained in:
Paul Sokolovsky 2015-01-15 00:21:57 +02:00
parent d2d64f00fb
commit c6b8750c14

View File

@ -38,11 +38,13 @@
#include "gccollect.h" #include "gccollect.h"
#include MICROPY_HAL_H #include MICROPY_HAL_H
STATIC char heap[16384];
void user_init(void) { void user_init(void) {
soft_reset: soft_reset:
mp_stack_set_limit(10240); mp_stack_set_limit(10240);
mp_hal_init(); mp_hal_init();
gc_init(&_heap_start, &_heap_end); gc_init(heap, heap + sizeof(heap));
gc_collect_init(); gc_collect_init();
mp_init(); mp_init();
mp_obj_list_init(mp_sys_path, 0); mp_obj_list_init(mp_sys_path, 0);