mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-07-22 20:59:03 +00:00
[sync] sync from internal repo
* use nuttx libc, disable system libc * use tlsf as default * update lhal flash driver * add example readme * add flash ini for new flash tool * add fw header for new flash tool
This commit is contained in:
parent
89592fc9a3
commit
356f258e83
554 changed files with 79150 additions and 46596 deletions
59
examples/bflog/freertos_async/example_log.h
Normal file
59
examples/bflog/freertos_async/example_log.h
Normal file
|
@ -0,0 +1,59 @@
|
|||
#ifndef _EXAMPLE_LOG_H
|
||||
#define _EXAMPLE_LOG_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include "bflog.h"
|
||||
|
||||
extern bflog_t example_recorder;
|
||||
|
||||
#define LOG_F(...) BFLOG_F((void *)&example_recorder, __VA_ARGS__)
|
||||
#define LOG_E(...) BFLOG_E((void *)&example_recorder, __VA_ARGS__)
|
||||
#define LOG_W(...) BFLOG_W((void *)&example_recorder, __VA_ARGS__)
|
||||
#define LOG_I(...) BFLOG_I((void *)&example_recorder, __VA_ARGS__)
|
||||
#define LOG_D(...) BFLOG_D((void *)&example_recorder, __VA_ARGS__)
|
||||
#define LOG_T(...) BFLOG_T((void *)&example_recorder, __VA_ARGS__)
|
||||
#define LOG_FLUSH() bflog_flush(&example_recorder)
|
||||
|
||||
extern void error_handler(void);
|
||||
|
||||
#ifdef CONFIG_ASSERT_DISABLE
|
||||
|
||||
#define _ASSERT_PARAM(x) ((void)(0))
|
||||
#define _ASSERT_FUNC(x) ((void)(x))
|
||||
#define _CALL_ERROR() error_handler()
|
||||
|
||||
#else
|
||||
|
||||
#define _CALL_ERROR() \
|
||||
do { \
|
||||
printf("(Call Error Handler)\r\n"); \
|
||||
LOG_F("Call Error Handler\r\n"); \
|
||||
LOG_FLUSH(); \
|
||||
error_handler(); \
|
||||
} while (0)
|
||||
|
||||
#define _ASSERT_PARAM(x) \
|
||||
if ((uint32_t)(x) == 0) { \
|
||||
printf("(Assertion Faild)\r\n"); \
|
||||
printf("(%s)\r\n", (const char *)(#x)); \
|
||||
LOG_F("Assertion Faild\r\n"); \
|
||||
LOG_F("%s\r\n", (const char *)(#x)); \
|
||||
LOG_FLUSH(); \
|
||||
error_handler(); \
|
||||
}
|
||||
|
||||
#define _ASSERT_FUNC(x) \
|
||||
do { \
|
||||
if ((uint32_t)(x) == 0) { \
|
||||
printf("(Assertion Faild)\r\n"); \
|
||||
printf("(%s)\r\n", (const char *)(#x)); \
|
||||
LOG_F("Assertion Faild\r\n"); \
|
||||
LOG_F("%s\r\n", (const char *)(#x)); \
|
||||
LOG_FLUSH(); \
|
||||
error_handler(); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue