extmod/modwebrepl: Add config option to put filebuf[512] on stack/bss.

Since the esp8266 has a small stack this buffer is kept in the BSS.
pull/1/head
Damien George 2019-07-03 12:55:57 +10:00
parent fa2c7ece8f
commit ef00048fed
2 changed files with 6 additions and 1 deletions

View File

@ -245,7 +245,11 @@ STATIC mp_uint_t _webrepl_read(mp_obj_t self_in, void *buf, mp_uint_t size, int
}
if (self->data_to_recv != 0) {
static byte filebuf[512];
// Ports that don't have much available stack can make this filebuf static
#if MICROPY_PY_WEBREPL_STATIC_FILEBUF
static
#endif
byte filebuf[512];
filebuf[0] = *(byte*)buf;
mp_uint_t buf_sz = 1;
if (--self->data_to_recv != 0) {

View File

@ -90,6 +90,7 @@
#define MICROPY_PY_UWEBSOCKET (1)
#define MICROPY_PY_WEBREPL (1)
#define MICROPY_PY_WEBREPL_DELAY (20)
#define MICROPY_PY_WEBREPL_STATIC_FILEBUF (1)
#define MICROPY_PY_FRAMEBUF (1)
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
#define MICROPY_PY_OS_DUPTERM (2)