luat_soc_sdk_2024 V1.0
luat_debug.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2022 OpenLuat & AirM2M
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy of
5 * this software and associated documentation files (the "Software"), to deal in
6 * the Software without restriction, including without limitation the rights to
7 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8 * the Software, and to permit persons to whom the Software is furnished to do so,
9 * subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in all
12 * copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 */
21
22#ifndef LUAT_DEBUG_H
23#define LUAT_DEBUG_H
24
41
48void luat_debug_print(const char *fmt, ...);
54#define LUAT_DEBUG_PRINT(fmt, argv...) luat_debug_print("%s %d:"fmt, __FUNCTION__,__LINE__, ##argv)
55
64void luat_debug_assert(const char *fun_name, unsigned int line_no, const char *fmt, ...);
65
66
67#define LUAT_DEBUG_ASSERT(condition, fmt, argv...) do { \
68 { \
69 if((condition) == 0) \
70 { \
71 luat_debug_assert(__FUNCTION__, __LINE__, fmt, ##argv); \
72 }\
73 } \
74 } while(0)
75
83
89void luat_debug_print_onoff(unsigned char onoff);
92#endif
void luat_debug_print_onoff(unsigned char onoff)
是否开启/停止csdk log
void luat_debug_print(const char *fmt,...)
格式打印并输出到LOG口
enum LUAT_DEBUG_FAULT_MODE LUAT_DEBUG_FAULT_MODE_E
出现异常后系统处理
LUAT_DEBUG_FAULT_MODE
出现异常后系统处理
void luat_debug_assert(const char *fun_name, unsigned int line_no, const char *fmt,...)
断言处理,并格式打印输出到LOG口
void luat_debug_set_fault_mode(LUAT_DEBUG_FAULT_MODE_E mode)
设置出现异常后系统处理模式
@ LUAT_DEBUG_FAULT_SAVE_RESET
@ LUAT_DEBUG_FAULT_HANG
@ LUAT_DEBUG_FAULT_RESET
@ LUAT_DEBUG_FAULT_HANG_RESET