mbed library sources. Supersedes mbed-src.
Dependents: SPIne CH_Communicatuin_Test CH_Communicatuin_Test2 MCP_SPIne ... more
Fork of mbed-dev-f303 by
Diff: platform/mbed_error.c
- Revision:
- 167:e84263d55307
- Parent:
- 160:d5399cc887bb
diff -r c97ed07ec1a8 -r e84263d55307 platform/mbed_error.c --- 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);