mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #1987 from openmv/nlr_cleanup
micropython: Add MICROPY_NLR_JUMP_HOOK.
This commit is contained in:
commit
dd8e82fa95
@ -66,6 +66,7 @@ DISPLAY_DIR=drivers/display
|
||||
LIBPDM_DIR=lib/libpdm
|
||||
TENSORFLOW_DIR=lib/libtf
|
||||
OMV_BOARD_CONFIG_DIR=$(TOP_DIR)/$(OMV_DIR)/boards/$(TARGET)/
|
||||
OMV_PORT_DIR=$(TOP_DIR)/$(OMV_DIR)/ports/$(PORT)
|
||||
MP_BOARD_CONFIG_DIR=$(TOP_DIR)/$(MICROPY_DIR)/ports/$(PORT)/boards/$(TARGET)/
|
||||
OMV_LIB_DIR=$(TOP_DIR)/../scripts/libraries
|
||||
FROZEN_MANIFEST=$(OMV_BOARD_CONFIG_DIR)/manifest.py
|
||||
@ -195,9 +196,10 @@ endif
|
||||
|
||||
MPY_PENDSV_ENTRIES := $(shell echo $(MPY_PENDSV_ENTRIES) | tr -d '[:space:]')
|
||||
MPY_CFLAGS += -DMICROPY_BOARD_PENDSV_ENTRIES="$(MPY_PENDSV_ENTRIES)"
|
||||
MPY_CFLAGS += -DMP_CONFIGFILE=\<$(OMV_PORT_DIR)/omv_mpconfigport.h\>
|
||||
|
||||
# Include the port Makefile.
|
||||
include $(OMV_DIR)/ports/$(PORT)/omv_portconfig.mk
|
||||
include $(OMV_PORT_DIR)/omv_portconfig.mk
|
||||
|
||||
clean:
|
||||
$(RM) -fr $(BUILD)
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 1f7bd319255924f2d17c40912c61b069503115e2
|
||||
Subproject commit 7f615a4a0f11e640dac20b8bc748385b4f5f67f3
|
||||
@ -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,
|
||||
|
||||
7
src/omv/ports/mimxrt/omv_mpconfigport.h
Normal file
7
src/omv/ports/mimxrt/omv_mpconfigport.h
Normal file
@ -0,0 +1,7 @@
|
||||
#include <mpconfigport.h>
|
||||
|
||||
#define MICROPY_NLR_RAISE_HOOK \
|
||||
do { \
|
||||
extern void fb_alloc_free_till_mark(); \
|
||||
fb_alloc_free_till_mark(); \
|
||||
} while (0);
|
||||
7
src/omv/ports/nrf/omv_mpconfigport.h
Normal file
7
src/omv/ports/nrf/omv_mpconfigport.h
Normal file
@ -0,0 +1,7 @@
|
||||
#include <mpconfigport.h>
|
||||
|
||||
#define MICROPY_NLR_RAISE_HOOK \
|
||||
do { \
|
||||
extern void fb_alloc_free_till_mark(); \
|
||||
fb_alloc_free_till_mark(); \
|
||||
} while (0);
|
||||
7
src/omv/ports/rp2/omv_mpconfigport.h
Normal file
7
src/omv/ports/rp2/omv_mpconfigport.h
Normal file
@ -0,0 +1,7 @@
|
||||
#include <mpconfigport.h>
|
||||
|
||||
#define MICROPY_NLR_RAISE_HOOK \
|
||||
do { \
|
||||
extern void fb_alloc_free_till_mark(); \
|
||||
fb_alloc_free_till_mark(); \
|
||||
} while (0);
|
||||
7
src/omv/ports/stm32/omv_mpconfigport.h
Normal file
7
src/omv/ports/stm32/omv_mpconfigport.h
Normal file
@ -0,0 +1,7 @@
|
||||
#include <mpconfigport.h>
|
||||
|
||||
#define MICROPY_NLR_RAISE_HOOK \
|
||||
do { \
|
||||
extern void fb_alloc_free_till_mark(); \
|
||||
fb_alloc_free_till_mark(); \
|
||||
} while (0);
|
||||
Loading…
Reference in New Issue
Block a user