Makro TRACEPLUS, verze 0.0.5
This commit is contained in:
parent
eb51464692
commit
b15ce02b2a
@ -12,7 +12,7 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.xpablo.cz/pablo2048/Trace.git"
|
"url": "https://git.xpablo.cz/pablo2048/Trace.git"
|
||||||
},
|
},
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"frameworks": "arduino",
|
"frameworks": "arduino",
|
||||||
"platforms": ["espressif8266","espressif32"],
|
"platforms": ["espressif8266","espressif32"],
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* @file trace.h
|
* @file trace.h
|
||||||
* @author Pavel Brychta, http://www.xpablo.cz
|
* @author Pavel Brychta, http://www.xpablo.cz
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-19 Pavel Brychta. All rights reserved.
|
* Copyright (c) 2016-22 Pavel Brychta. All rights reserved.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -125,6 +125,7 @@ void trace_forceupdate(void);
|
|||||||
#define STRINGIFY(x) #x
|
#define STRINGIFY(x) #x
|
||||||
#define TOSTRING(x) STRINGIFY(x)
|
#define TOSTRING(x) STRINGIFY(x)
|
||||||
|
|
||||||
|
#define TRACEPLUS(when, severity, ...) if (when != 0) TRACE(severity, __VA_ARGS__)
|
||||||
#define TRACE(severity, ...) trace_print(severity, __VA_ARGS__)
|
#define TRACE(severity, ...) trace_print(severity, __VA_ARGS__)
|
||||||
#define TRACEFUNC(severity, ...) trace_printfunc(severity, __func__, __FILE__, TOSTRING(__LINE__), __VA_ARGS__)
|
#define TRACEFUNC(severity, ...) trace_printfunc(severity, __func__, __FILE__, TOSTRING(__LINE__), __VA_ARGS__)
|
||||||
#define TRACEDUMP(severity, prefix, address, size) trace_dump(severity, prefix, address, size)
|
#define TRACEDUMP(severity, prefix, address, size) trace_dump(severity, prefix, address, size)
|
||||||
@ -134,6 +135,7 @@ void trace_forceupdate(void);
|
|||||||
#define TRACE_FORCEUPDATE(a) trace_forceupdate()
|
#define TRACE_FORCEUPDATE(a) trace_forceupdate()
|
||||||
|
|
||||||
#else // DONT_USE_TRACE
|
#else // DONT_USE_TRACE
|
||||||
|
#define TRACEPLUS(...) ((void)0)
|
||||||
#define TRACE(...) ((void)0) // from assert.h "NOP" - http://stackoverflow.com/questions/9187628/c-empty-function-macros
|
#define TRACE(...) ((void)0) // from assert.h "NOP" - http://stackoverflow.com/questions/9187628/c-empty-function-macros
|
||||||
#define TRACEFUNC(...) ((void)0)
|
#define TRACEFUNC(...) ((void)0)
|
||||||
#define TRACEDUMP(...) ((void)0)
|
#define TRACEDUMP(...) ((void)0)
|
||||||
|
Loading…
Reference in New Issue
Block a user