[port/fal] add option to use native assert() (#225)

This commit is contained in:
benpicco 2023-08-08 04:36:07 +02:00 committed by GitHub
parent 07dcd7f035
commit d01c0d48aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,9 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#ifdef FDB_USING_NATIVE_ASSERT
#include <assert.h>
#endif
#define FAL_SW_VERSION "0.5.99" #define FAL_SW_VERSION "0.5.99"
@ -50,6 +53,7 @@
#endif #endif
#if FAL_DEBUG #if FAL_DEBUG
#ifndef FDB_USING_NATIVE_ASSERT
#ifdef assert #ifdef assert
#undef assert #undef assert
#endif #endif
@ -59,6 +63,7 @@ if (!(EXPR)) \
FAL_PRINTF("(%s) has assert failed at %s.\n", #EXPR, __func__ ); \ FAL_PRINTF("(%s) has assert failed at %s.\n", #EXPR, __func__ ); \
while (1); \ while (1); \
} }
#endif
/* debug level log */ /* debug level log */
#ifdef log_d #ifdef log_d
@ -69,10 +74,12 @@ if (!(EXPR)) \
#else #else
#ifndef FDB_USING_NATIVE_ASSERT
#ifdef assert #ifdef assert
#undef assert #undef assert
#endif #endif
#define assert(EXPR) ((void)0); #define assert(EXPR) ((void)0);
#endif
/* debug level log */ /* debug level log */
#ifdef log_d #ifdef log_d