Remove incorrect override for LWIP_PLATFORM_ASSERT (#1064)

* Remove incorrect override for LWIP_PLATFORM_ASSERT

LWIP_PLATFORM_ASSERT macro is used by lwip driver implementations to specify the behavior of the assertions in lwip code.

The previous override of this macro incorrectly assumed that the parameter to the function macro was the condition to check. However this is incorrect. The parameter is actually a message string defining what failed. 

This mistake caused all assertions to be ignored. ( and myself to loose many hours of debugging time )

By removing this, we restore the default behavior specified by lwip which is to use `printf` to log the message.

* I think i prefer to use panic (which doesn't pull in fflush etc)

Co-authored-by: Graham Sanderson <graham.sanderson@gmail.com>
This commit is contained in:
James Peach 2022-10-21 14:57:21 +01:00 committed by GitHub
parent b0294d6bf4
commit 16ab2b21ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,10 @@ typedef int sys_prot_t;
#endif #endif
#define LWIP_PLATFORM_ASSERT(x) do { if(!(x)) while(1); } while(0) #ifndef LWIP_PLATFORM_ASSERT
void panic(const char *fmt, ...);
#define LWIP_PLATFORM_ASSERT(x) panic(x)
#endif
unsigned int pico_lwip_rand(void); unsigned int pico_lwip_rand(void);
#ifndef LWIP_RAND #ifndef LWIP_RAND