Forked.
Fork of mbed-dev by
Diff: platform/mbed_error.c
- Revision:
- 167:e84263d55307
- Parent:
- 160:d5399cc887bb
- Child:
- 174:ed647f63e28d
--- a/platform/mbed_error.c Thu Jun 08 15:02:37 2017 +0100 +++ b/platform/mbed_error.c Wed Jun 21 17:46:44 2017 +0100 @@ -23,7 +23,16 @@ #include <stdio.h> #endif +static uint8_t error_in_progress = 0; + WEAK void error(const char* format, ...) { + + // Prevent recursion if error is called again + if (error_in_progress) { + return; + } + error_in_progress = 1; + #ifndef NDEBUG va_list arg; va_start(arg, format);