Commit c8b80e47 authored by Paul Sokolovsky's avatar Paul Sokolovsky

lib/embed/abort_: Implementation of abort_() function raising uPy exception.

Helpful when porting existing C libraries to MicroPython. abort()ing in
embedded environment isn't a good idea, so when compiling such library,
-Dabort=abort_ option can be given to redirect standard abort() to this
"safe" version.
parent 4f1b0292
#include <py/runtime.h>
void abort_(void) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_RuntimeError, "abort() called"));
}
......@@ -221,6 +221,7 @@ PY_O_BASENAME = \
../extmod/vfs_fat_lexer.o \
../extmod/vfs_fat_misc.o \
../extmod/moduos_dupterm.o \
../lib/embed/abort_.o \
# prepend the build destination prefix to the py object files
PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME))
......
Markdown is supported
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