mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
micropython: Add MICROPY_NLR_RAISE_HOOK.
- This can be set from a custom mpconfigport.h file to call fb_alloc_free or any other needed cleanup before an exception. - The omvdummy stuff is no longer needed since a default empty hook is defined.
This commit is contained in:
parent
ec40364ed4
commit
c4511338a2
@ -1 +1 @@
|
|||||||
Subproject commit 1f7bd319255924f2d17c40912c61b069503115e2
|
Subproject commit 7f615a4a0f11e640dac20b8bc748385b4f5f67f3
|
||||||
@ -56,8 +56,8 @@ void fb_alloc_mark() {
|
|||||||
|
|
||||||
// Check if allocation overwrites the framebuffer pixels
|
// Check if allocation overwrites the framebuffer pixels
|
||||||
if (new_pointer < framebuffer_get_buffers_end()) {
|
if (new_pointer < framebuffer_get_buffers_end()) {
|
||||||
nlr_raise_for_fb_alloc_mark(mp_obj_new_exception_msg(&mp_type_MemoryError,
|
nlr_jump(MP_OBJ_TO_PTR(mp_obj_new_exception_msg(&mp_type_MemoryError,
|
||||||
MP_ERROR_TEXT("Out of fast frame buffer stack memory")));
|
MP_ERROR_TEXT("Out of fast frame buffer stack memory"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// fb_alloc does not allow regions which are a size of 0 to be alloced,
|
// fb_alloc does not allow regions which are a size of 0 to be alloced,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user