mirror of https://github.com/ARMmbed/mbed-os.git
assert - use fprintf (if serial=1) and mbed_die
parent
d898c11e42
commit
985255dbb5
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue