Skip to content

lower lwip2 ram and flash footprint (by disabling old asserts) #4150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tools/sdk/include/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified tools/sdk/lib/liblwip2.a
Binary file not shown.
Binary file modified tools/sdk/lib/liblwip2_1460.a
Binary file not shown.
9 changes: 6 additions & 3 deletions tools/sdk/lwip2/README.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tools/sdk/lwip2/builder
Submodule builder updated 1 files
+16 −1 glue/gluedebug.h
17 changes: 16 additions & 1 deletion tools/sdk/lwip2/include/gluedebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down