diff --git a/basic/zlog.h b/basic/zlog.h index b16cc93..3769a5f 100644 --- a/basic/zlog.h +++ b/basic/zlog.h @@ -37,6 +37,11 @@ extern void zdelay_ms(int ms); #define ZASSERT(cond) ASSERT(cond, "") #define ZASSERT_INFO(cond, info) ASSERT(cond, info) +#define HAL_ASSERT(exptr) \ + { \ + HAL_StatusTypeDef status = (exptr); \ + ASSERT(status == HAL_OK, #exptr); \ + } #define ZARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))