assert - use fprintf (if serial=1) and mbed_die

pull/1795/head
0xc0170 2016-05-26 15:36:32 +01:00
parent d898c11e42
commit 985255dbb5
1 changed files with 12 additions and 2 deletions

View File

@ -14,9 +14,19 @@
* limitations under the License.
*/
#include "mbed_assert.h"
#include "mbed_error.h"
#include "device.h"
#if DEVICE_STDIO_MESSAGES
#include <stdio.h>
#endif
#include <stdlib.h>
#include "mbed_interface.h"
void mbed_assert_internal(const char *expr, const char *file, int line)
{
error("mbed assertation failed: %s, file: %s, line %d \n", expr, file, line);
#if DEVICE_STDIO_MESSAGES
fprintf(stderr, "mbed assertation failed: %s, file: %s, line %d \n", expr, file, line);
#endif
mbed_die();
}