Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
4039a266
Commit
4039a266
authored
Jun 30, 2014
by
Damien George
Browse files
Merge pull request #710 from iabdalkader/assert
Fix assert_func warning/error
parents
b601d957
89b38d96
Changes
2
Hide whitespace changes
Inline
Side-by-side
py/mpconfig.h
View file @
4039a266
...
...
@@ -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
stmhal/main.c
View file @
4039a266
...
...
@@ -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
(
""
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment