From 1e3db3bb1a59f2b1ca4d5e1529d75ea80db97ddc Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 26 Nov 2024 20:35:39 +0800 Subject: [PATCH] update --- basic/zlog.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/basic/zlog.h b/basic/zlog.h index b16cc93..4a08c40 100644 --- a/basic/zlog.h +++ b/basic/zlog.h @@ -35,8 +35,15 @@ extern void zdelay_ms(int ms); } \ } -#define ZASSERT(cond) ASSERT(cond, "") -#define ZASSERT_INFO(cond, info) ASSERT(cond, info) +#define ZASSERT_INFO(cond, fmt, ...) \ + if (!(cond)) { \ + while (1) { \ + zlog("ASSERT: %s [%s:%d]" fmt "\n", #cond, __FILE__, __LINE__, ##__VA_ARGS__); \ + zdelay_ms(1000); \ + } \ + } + +#define ZASSERT(cond) ASSERT(cond, "") #define ZARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))