debug: make ASSERT empty under release version

ASSERT is only for debug purpose, for release version, it should try
error handling instead of deadloop there.

v1:
- change the ASSERT under release version to empty code

TODO: revise all ASSERT usage

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong (Eddie.dong@intel.com)
This commit is contained in:
Jason Chen CJ 2018-03-25 17:44:20 +08:00 committed by Jack Ren
parent 6ee72d7df9
commit 170c48a9fc
1 changed files with 1 additions and 6 deletions

View File

@ -40,12 +40,7 @@ void __assert(uint32_t line, const char *file, char *txt);
__assert(__LINE__, __FILE__, "fatal error");\ __assert(__LINE__, __FILE__, "fatal error");\
} }
#else #else
#define ASSERT(x, ...) \ #define ASSERT(x, ...) do { } while(0)
if (!(x)) { \
do { \
asm volatile ("pause" ::: "memory"); \
} while (1); \
}
#endif #endif
/* Force a compilation error if condition is false */ /* Force a compilation error if condition is false */