feat(assert): refactoring LV_ASSERT_HANDLER handling (#8434)

This commit is contained in:
Benign X
2025-06-17 06:00:52 +08:00
committed by GitHub
parent 1a36c4e61d
commit eee9ffa55f
2 changed files with 48 additions and 3 deletions
+43
View File
@@ -0,0 +1,43 @@
/**
* @file lv_assert.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_assert.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_assert_handler(void)
{
LV_ASSERT_HANDLER
}
/**********************
* STATIC FUNCTIONS
**********************/
+5 -3
View File
@@ -30,6 +30,8 @@ extern "C" {
* GLOBAL PROTOTYPES
**********************/
void lv_assert_handler(void);
/**********************
* MACROS
**********************/
@@ -38,7 +40,7 @@ extern "C" {
do { \
if(!(expr)) { \
LV_LOG_ERROR("Asserted at expression: %s", #expr); \
LV_ASSERT_HANDLER \
lv_assert_handler(); \
} \
} while(0)
@@ -46,7 +48,7 @@ extern "C" {
do { \
if(!(expr)) { \
LV_LOG_ERROR("Asserted at expression: %s (%s)", #expr, msg); \
LV_ASSERT_HANDLER \
lv_assert_handler(); \
} \
} while(0)
@@ -54,7 +56,7 @@ extern "C" {
do { \
if(!(expr)) { \
LV_LOG_ERROR("Asserted at expression: %s " format , #expr, __VA_ARGS__); \
LV_ASSERT_HANDLER \
lv_assert_handler(); \
} \
} while(0)