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.
This commit is contained in:
parent
4f1b0292db
commit
c8b80e4740
5
lib/embed/abort_.c
Normal file
5
lib/embed/abort_.c
Normal file
@ -0,0 +1,5 @@
|
||||
#include <py/runtime.h>
|
||||
|
||||
void abort_(void) {
|
||||
nlr_raise(mp_obj_new_exception_msg(&mp_type_RuntimeError, "abort() called"));
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user