mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-20 12:32:18 +08:00
feat(assert): refactoring LV_ASSERT_HANDLER handling (#8434)
This commit is contained in:
@@ -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
|
||||
**********************/
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user