Skip to content

Commit ff8133f

Browse files
author
Tommi Käsmä
committed
add mbed_lib.json trace enable config option (#32)
1 parent def077c commit ff8133f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

mbed-trace/mbed_trace.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ extern "C" {
6161
#define YOTTA_CFG_MBED_TRACE_FEA_IPV6 1
6262
#endif
6363

64+
#ifndef MBED_CONF_MBED_TRACE_ENABLE
65+
#define MBED_CONF_MBED_TRACE_ENABLE 0
66+
#endif
67+
6468
/** 3 upper bits are trace modes related,
6569
and 5 lower bits are trace level configuration */
6670

@@ -334,7 +338,7 @@ char* mbed_trace_array(const uint8_t* buf, uint16_t len);
334338
* If tracing is disabled, the dummies will hide the real functions. The real functions can still be reached by
335339
* surrounding the name of the function with brackets, e.g. "(mbed_tracef)(dlevel, grp, "like so");"
336340
* */
337-
#if defined(FEA_TRACE_SUPPORT) || defined(YOTTA_CFG_MBED_TRACE) || (defined(YOTTA_CFG) && !defined(NDEBUG))
341+
#if defined(FEA_TRACE_SUPPORT) || MBED_CONF_MBED_TRACE_ENABLE || defined(YOTTA_CFG_MBED_TRACE) || (defined(YOTTA_CFG) && !defined(NDEBUG))
338342
// undefine dummies, revealing the real functions
339343
#undef MBED_TRACE_DUMMIES_DEFINED
340344
#undef mbed_trace_init

mbed_lib.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "mbed-trace",
3+
"config": {
4+
"enable": {
5+
"help": "Used to globally enable traces.",
6+
"value": null
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)