diff --git a/tools/sdk/include/mem.h b/tools/sdk/include/mem.h index 9fe13a8bf..c9231af8e 100644 --- a/tools/sdk/include/mem.h +++ b/tools/sdk/include/mem.h @@ -43,7 +43,8 @@ bool ICACHE_FLASH_ATTR check_memleak_debug_enable(void) #define os_malloc malloc #define os_calloc calloc #define os_realloc realloc -#define os_zalloc zalloc +#define os_zalloc(s) calloc(1,s) +#define zalloc(s) calloc(1,s) #ifndef MEMLEAK_DEBUG #define MEMLEAK_DEBUG_ENABLE 0 diff --git a/tools/sdk/lib/liblwip2.a b/tools/sdk/lib/liblwip2.a index ac55498a1..451dd36c6 100644 Binary files a/tools/sdk/lib/liblwip2.a and b/tools/sdk/lib/liblwip2.a differ diff --git a/tools/sdk/lib/liblwip2_1460.a b/tools/sdk/lib/liblwip2_1460.a index 1458c584a..62bb4c02c 100644 Binary files a/tools/sdk/lib/liblwip2_1460.a and b/tools/sdk/lib/liblwip2_1460.a differ diff --git a/tools/sdk/lwip2/README.md b/tools/sdk/lwip2/README.md index cb6b2d793..406307101 100644 --- a/tools/sdk/lwip2/README.md +++ b/tools/sdk/lwip2/README.md @@ -1,10 +1,13 @@ +```make install```: download, compile, install lwip2 -make install download, compile, install lwip2 -make download download lwIP-2 builder -make clean clean builder only +```make download```: download lwIP-2 builder + +```make clean```: clean builder only glue and lwIP debug options are in builder/glue/gluedebug.h + MSS values are in builder/Makefile.arduino + MSS values in boards.txt are only informative current lwip2 submodule repository: https://github.com/d-a-v/esp82xx-nonos-linklayer/tree/arduino-2.4.0 diff --git a/tools/sdk/lwip2/builder b/tools/sdk/lwip2/builder index afc929779..1b8826735 160000 --- a/tools/sdk/lwip2/builder +++ b/tools/sdk/lwip2/builder @@ -1 +1 @@ -Subproject commit afc929779c7fcf23c6253f0cc71b1cf0bc83183f +Subproject commit 1b8826735cffa57d71ff6ce1fd79ec9d44a5215f diff --git a/tools/sdk/lwip2/include/gluedebug.h b/tools/sdk/lwip2/include/gluedebug.h index 71bc30efc..03c9a1781 100644 --- a/tools/sdk/lwip2/include/gluedebug.h +++ b/tools/sdk/lwip2/include/gluedebug.h @@ -8,6 +8,7 @@ // this is needed separately from lwipopts.h // because it is shared by both sides of glue +#define UNDEBUG 1 // 0 or 1 (1: uassert removed) #define UDEBUG 0 // 0 or 1 (glue debug) #define UDUMP 0 // 0 or 1 (glue / dump packet) #define UDEBUGINDEX 0 // 0 or 1 (show debug line number) @@ -81,8 +82,22 @@ int doprint_minus (const char* format, ...) __attribute__ ((format (printf, 1, 2 #define uprint(x...) do { (void)0; } while (0) #endif +#if UNDEBUG +#define uassert(assertion...) do { (void)0; } while (0) +#else // !defined(UNDEBUG) +#define uassert(assertion...) \ +do { if ((assertion) == 0) { \ + static const char assrt[] ICACHE_RODATA_ATTR STORE_ATTR = #assertion " wrong@"; \ + os_printf_plus(assrt); \ + static const char assrt_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \ + os_printf_plus(assrt_file); \ + static const char assrt_line[] ICACHE_RODATA_ATTR STORE_ATTR = ":%d\n"; \ + os_printf_plus(assrt_line, __LINE__); \ + uhalt(); \ +} } while (0) +#endif // !defined(UNDEBUG) + #define uerror(x...) do { doprint(x); } while (0) -#define uassert(assertion...) do { if ((assertion) == 0) { os_printf_plus("assert fail: " #assertion " @%s:%d\n", __FILE__, __LINE__); uhalt(); } } while (0) #define uhalt() do { *((int*)0) = 0; /* this triggers gdb */ } while (0) #define nl() do { uprint("\n"); } while (0)