Commit 4039a266 authored by Damien George's avatar Damien George
Browse files

Merge pull request #710 from iabdalkader/assert

Fix assert_func warning/error
parents b601d957 89b38d96
......@@ -404,3 +404,8 @@ typedef double mp_float_t;
#ifndef NORETURN
#define NORETURN __attribute__((noreturn))
#endif
// Modifier for weak functions
#ifndef MP_WEAK
#define MP_WEAK __attribute__((weak))
#endif
......@@ -86,7 +86,7 @@ void flash_error(int n) {
led_state(PYB_LED_R2, 0);
}
void __fatal_error(const char *msg) {
void NORETURN __fatal_error(const char *msg) {
for (volatile uint delay = 0; delay < 10000000; delay++) {
}
led_state(1, 1);
......@@ -112,8 +112,7 @@ void nlr_jump_fail(void *val) {
}
#ifndef NDEBUG
void __attribute__((weak))
__assert_func(const char *file, int line, const char *func, const char *expr) {
void MP_WEAK __assert_func(const char *file, int line, const char *func, const char *expr) {
(void)func;
printf("Assertion '%s' failed, at file %s:%d\n", expr, file, line);
__fatal_error("");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment