mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
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:
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"));
|
||||
}
|
||||
Reference in New Issue
Block a user