Add note about high resource-consumption in LWIP_PLATFORM_DIAG and LWIP_PLATFORM_ASSERT default implementations

This commit is contained in:
Dirk Ziegelmeier 2017-01-02 19:06:33 +01:00
parent e12bb2a4eb
commit e3c2b8a339

View File

@ -70,14 +70,22 @@
#define LWIP_RAND() ((u32_t)rand())
#endif
/** Platform specific diagnostic output */
/** Platform specific diagnostic output.\n
* Note the default implementation pulls in printf, which may
* in turn pull in a lot of standard libary code. In resource-constrained
* systems, this should be defined to something less resource-consuming.
*/
#ifndef LWIP_PLATFORM_DIAG
#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
#include <stdio.h>
#include <stdlib.h>
#endif
/** Platform specific assertion handling */
/** Platform specific assertion handling.\n
* Note the default implementation pulls in printf, fflush and abort, which may
* in turn pull in a lot of standard libary code. In resource-constrained
* systems, this should be defined to something less resource-consuming.
*/
#ifndef LWIP_PLATFORM_ASSERT
#define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \
x, __LINE__, __FILE__); fflush(NULL); abort();} while(0)