From c4511338a2603029e5bc7b177234d0f59a63d228 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Tue, 24 Oct 2023 20:35:42 +0200 Subject: [PATCH] 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. --- src/micropython | 2 +- src/omv/alloc/fb_alloc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/micropython b/src/micropython index 1f7bd3192..7f615a4a0 160000 --- a/src/micropython +++ b/src/micropython @@ -1 +1 @@ -Subproject commit 1f7bd319255924f2d17c40912c61b069503115e2 +Subproject commit 7f615a4a0f11e640dac20b8bc748385b4f5f67f3 diff --git a/src/omv/alloc/fb_alloc.c b/src/omv/alloc/fb_alloc.c index 4f6ee26c2..7d49878da 100644 --- a/src/omv/alloc/fb_alloc.c +++ b/src/omv/alloc/fb_alloc.c @@ -56,8 +56,8 @@ void fb_alloc_mark() { // Check if allocation overwrites the framebuffer pixels if (new_pointer < framebuffer_get_buffers_end()) { - nlr_raise_for_fb_alloc_mark(mp_obj_new_exception_msg(&mp_type_MemoryError, - MP_ERROR_TEXT("Out of fast frame buffer stack memory"))); + nlr_jump(MP_OBJ_TO_PTR(mp_obj_new_exception_msg(&mp_type_MemoryError, + 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,