diff --git a/src/main.cpp b/src/main.cpp index b70c4b6..bd46c6f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,6 +14,7 @@ #include "mbed.h" #define TRACE_GROUP "APP" +#if MBED_CONF_MBED_TRACE_ENABLE // mutex setup for tracing in thread safe mode static Mutex traceMutex; @@ -22,9 +23,7 @@ static void trace_mutex_release() { traceMutex.unlock(); } -int main() { - // setup and initialisation of the tracing subsystem - +void setup_tracing(void) { char trace_filters[] = "APP,FS,FLER,SNTP,USBM"; mbed_trace_mutex_wait_function_set(trace_mutex_wait); mbed_trace_mutex_release_function_set(trace_mutex_release); @@ -34,6 +33,15 @@ tr_info("Info tracing enabled"); tr_warn("Warning tracing enabled"); tr_err("Error tracing enabled"); +} +#else +void setup_tracing(void) { + // do nothing +} +#endif + +int main() { + setup_tracing(); tr_info("Project Tardis");