1717#define ULWIPDEBUG 0 // 0 or 1 (trigger lwip debug)
1818#define ULWIPASSERT 0 // 0 or 1 (trigger lwip self-check, 0 saves flash)
1919
20- #define STRING_IN_FLASH 0 // *print("fmt is stored in flash")
20+ #define STRING_IN_FLASH 1 // *print("fmt is stored in flash")
2121
2222#define ROTBUFLEN_BIT 11 // (UDEBUGSTORE=1) doprint()'s buffer: 11=2048B
2323
@@ -82,10 +82,7 @@ int doprint_minus (const char* format, ...) __attribute__ ((format (printf, 1, 2
8282#define uprint (x ...) do { (void)0; } while (0)
8383#endif
8484
85- #if UNDEBUG
86- #define uassert (assertion ...) do { (void)0; } while (0)
87- #else // !defined(UNDEBUG)
88- #define uassert (assertion ...) \
85+ #define udoassert (assertion ...) \
8986do { if ((assertion) == 0) { \
9087 static const char assrt[] ICACHE_RODATA_ATTR STORE_ATTR = #assertion " wrong@"; \
9188 os_printf_plus(assrt); \
@@ -95,8 +92,15 @@ do { if ((assertion) == 0) { \
9592 os_printf_plus(assrt_line, __LINE__); \
9693 uhalt(); \
9794} } while (0)
95+
96+ #if UNDEBUG
97+ #define uassert (assertion ...) do { (void)0; } while (0)
98+ #else // !defined(UNDEBUG)
99+ #define uassert (assertion ...) udoassert(assertion)
98100#endif // !defined(UNDEBUG)
99101
102+ #define ualwaysassert (assertion ...) udoassert(assertion)
103+
100104#define uerror (x ...) do { doprint(x); } while (0)
101105#define uhalt () do { *((int*)0) = 0; /* this triggers gdb */ } while (0 )
102106#define nl () do { uprint("\n"); } while (0)
0 commit comments