kopia lustrzana https://github.com/micropython/micropython
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.pull/2245/merge
rodzic
4f1b0292db
commit
c8b80e4740
|
@ -0,0 +1,5 @@
|
|||
#include <py/runtime.h>
|
||||
|
||||
void abort_(void) {
|
||||
nlr_raise(mp_obj_new_exception_msg(&mp_type_RuntimeError, "abort() called"));
|
||||
}
|
1
py/py.mk
1
py/py.mk
|
@ -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))
|
||||
|
|
Ładowanie…
Reference in New Issue