Hi everyone,
I am using the nRF51 SDK 10.0. The documentation for the Debug Logger API suggests sample code like:
uint32_t retval; // Initialize module
retval = app_trace_init();
if (retval == NRF_SUCCESS) {
// Module successfully initialized.
} else {
// Module initialization failed. Take corrective action.
}
However, if you do this without the macro ENABLE_DEBUG_LOG_SUPPORT set, GCC 4.9 will correctly say
error: expected primary-expression before ';' token
I therefore suggest the following change to app_trace.h:
#else // ENABLE_DEBUG_LOG_SUPPORT
-#define app_trace_init(...)
+#define app_trace_init(...) NRF_ERROR_NOT_SUPPORTED
#define app_trace_log(...)
#define app_trace_dump(...)
EDIT: I just realized that there is an even bigger confusion with app_trace_init. It does not return a value at all! So it should actually be fixed so that it returns a value and then in the way above if debugging is disabled.