mirror of https://github.com/ARMmbed/mbed-os.git
Remove error reporting for release builds
parent
c5a2f3c993
commit
3eaca32964
|
@ -45,6 +45,11 @@
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
#define ERROR_REPORT(ctx, error_msg) print_error_report(ctx, error_msg)
|
||||||
|
#else
|
||||||
|
#define ERROR_REPORT(ctx, error_msg) ((void) 0)
|
||||||
|
#endif
|
||||||
|
|
||||||
static uint8_t error_in_progress = 0;
|
static uint8_t error_in_progress = 0;
|
||||||
static int error_count = 0;
|
static int error_count = 0;
|
||||||
|
@ -78,9 +83,7 @@ WEAK void error(const char *format, ...)
|
||||||
|
|
||||||
//Call handle_error/print_error_report permanently setting error_in_progress flag
|
//Call handle_error/print_error_report permanently setting error_in_progress flag
|
||||||
handle_error(MBED_ERROR_UNKNOWN, 0, NULL, 0);
|
handle_error(MBED_ERROR_UNKNOWN, 0, NULL, 0);
|
||||||
#ifndef NDEBUG
|
ERROR_REPORT(&last_error_ctx, "Fatal Run-time error");
|
||||||
print_error_report(&last_error_ctx, "Fatal Run-time error");
|
|
||||||
#endif
|
|
||||||
error_in_progress = 1;
|
error_in_progress = 1;
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
@ -201,10 +204,8 @@ WEAK mbed_error_status_t mbed_error(mbed_error_status_t error_status, const char
|
||||||
return MBED_ERROR_FAILED_OPERATION;
|
return MBED_ERROR_FAILED_OPERATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
//On fatal errors print the error context/report
|
//On fatal errors print the error context/report
|
||||||
print_error_report(&last_error_ctx, error_msg);
|
ERROR_REPORT(&last_error_ctx, error_msg);
|
||||||
#endif
|
|
||||||
mbed_halt_system();
|
mbed_halt_system();
|
||||||
|
|
||||||
return MBED_ERROR_FAILED_OPERATION;
|
return MBED_ERROR_FAILED_OPERATION;
|
||||||
|
@ -306,6 +307,7 @@ static void print_threads_info(osRtxThread_t *threads)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
static void print_error_report(mbed_error_ctx *ctx, const char *error_msg)
|
static void print_error_report(mbed_error_ctx *ctx, const char *error_msg)
|
||||||
{
|
{
|
||||||
uint32_t error_code = MBED_GET_ERROR_CODE(ctx->error_status);
|
uint32_t error_code = MBED_GET_ERROR_CODE(ctx->error_status);
|
||||||
|
@ -390,6 +392,7 @@ static void print_error_report(mbed_error_ctx *ctx, const char *error_msg)
|
||||||
|
|
||||||
mbed_error_printf("\n-- MbedOS Error Info --\n");
|
mbed_error_printf("\n-- MbedOS Error Info --\n");
|
||||||
}
|
}
|
||||||
|
#endif //ifndef NDEBUG
|
||||||
|
|
||||||
#if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED
|
#if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED
|
||||||
//Retrieve the error context from error log at the specified index
|
//Retrieve the error context from error log at the specified index
|
||||||
|
|
Loading…
Reference in New Issue