mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-13 17:43:27 +00:00
FreeRTOS: Configure configASSERT fail behaviour, abort() by default
This commit is contained in:
@@ -106,12 +106,25 @@
|
||||
#include "xtensa_config.h"
|
||||
|
||||
|
||||
#if 1
|
||||
/* configASSERT behaviour */
|
||||
#ifndef __ASSEMBLER__
|
||||
#include "rom/ets_sys.h"
|
||||
#define configASSERT(a) if (!(a)) ets_printf("%s:%d (%s)- assert failed!\n", __FILE__, __LINE__, __FUNCTION__)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_FREERTOS_ASSERT_DISABLE)
|
||||
#define configASSERT(a) /* assertions disabled */
|
||||
#elif defined(CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE)
|
||||
#define configASSERT(a) if (!(a)) { \
|
||||
ets_printf("%s:%d (%s)- assert failed!\n", __FILE__, __LINE__, \
|
||||
__FUNCTION__); \
|
||||
}
|
||||
#else /* CONFIG_FREERTOS_ASSERT_FAIL_ABORT */
|
||||
#define configASSERT(a) if (!(a)) { \
|
||||
ets_printf("%s:%d (%s)- assert failed!\n", __FILE__, __LINE__, \
|
||||
__FUNCTION__); \
|
||||
abort(); \
|
||||
}
|
||||
#endif
|
||||
#endif /* def __ASSEMBLER__ */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user