diff --git a/src/micropython b/src/micropython index 8e0531df1..7a39d7999 160000 --- a/src/micropython +++ b/src/micropython @@ -1 +1 @@ -Subproject commit 8e0531df1397cee56c6d9d18f8af2220fa4c3d1f +Subproject commit 7a39d799900826ff07bb427633a8ad857e6afe42 diff --git a/src/omv/boards/NANO33/omv_boardconfig.mk b/src/omv/boards/NANO33/omv_boardconfig.mk new file mode 100755 index 000000000..cbe77f031 --- /dev/null +++ b/src/omv/boards/NANO33/omv_boardconfig.mk @@ -0,0 +1,15 @@ +MCU=NRF52840 +CPU=cortex-m4 +FPU=fpv4-sp-d16 +PORT=nrf +SD=s140 +HAL_DIR=hal/nrfx +NRF_SOFTDEV=s140_nrf52_6.1.1 +ARM_MATH=ARM_MATH_CM4 +CFLAGS_MCU=NRF52_SERIES +OMV_BOARD_EXTRA_CFLAGS = -DCONFIG_GPIO_AS_PINRESET -DNRF52840_XXAA -DSOFTDEVICE_PRESENT -DBLUETOOTH_SD_DEBUG=1 -DBLUETOOTH_SD=140 +VECT_TAB_OFFSET=0x26000 +MAIN_APP_ADDR=0x00026000 +OMV_HSE_VALUE=12000000 +DFU_DEVICE=0x0483:0xdf11 +MICROPY_PY_ULAB=1 diff --git a/src/omv/boards/OPENMV1/omv_boardconfig.mk b/src/omv/boards/OPENMV1/omv_boardconfig.mk index 605327fe0..206e0ec7e 100755 --- a/src/omv/boards/OPENMV1/omv_boardconfig.mk +++ b/src/omv/boards/OPENMV1/omv_boardconfig.mk @@ -12,5 +12,6 @@ OMV_HSE_VALUE=12000000 DFU_DEVICE=0x0483:0xdf11 OMV_ENABLE_BL=1 OMV_ENABLE_UVC=1 +MICROPY_PY_SENSOR = 1 MICROPY_PY_WINC1500 = 1 $(error "This camera is no longer supported :O Have fun hacking the code $(BRACKET)") diff --git a/src/omv/boards/OPENMV2/omv_boardconfig.mk b/src/omv/boards/OPENMV2/omv_boardconfig.mk index 3e6f2fb72..b1e99d126 100755 --- a/src/omv/boards/OPENMV2/omv_boardconfig.mk +++ b/src/omv/boards/OPENMV2/omv_boardconfig.mk @@ -12,4 +12,5 @@ OMV_HSE_VALUE=12000000 DFU_DEVICE=0x0483:0xdf11 OMV_ENABLE_BL=1 OMV_ENABLE_UVC=1 +MICROPY_PY_SENSOR = 1 MICROPY_PY_WINC1500 = 1 diff --git a/src/omv/boards/OPENMV3/omv_boardconfig.mk b/src/omv/boards/OPENMV3/omv_boardconfig.mk index 5bdcbd671..0cadbe535 100755 --- a/src/omv/boards/OPENMV3/omv_boardconfig.mk +++ b/src/omv/boards/OPENMV3/omv_boardconfig.mk @@ -12,5 +12,6 @@ OMV_HSE_VALUE=12000000 DFU_DEVICE=0x0483:0xdf11 OMV_ENABLE_BL=1 OMV_ENABLE_UVC=1 +MICROPY_PY_SENSOR = 1 MICROPY_PY_ULAB = 1 MICROPY_PY_WINC1500 = 1 diff --git a/src/omv/boards/OPENMV4/omv_boardconfig.mk b/src/omv/boards/OPENMV4/omv_boardconfig.mk index 53729da0c..d84536fa3 100755 --- a/src/omv/boards/OPENMV4/omv_boardconfig.mk +++ b/src/omv/boards/OPENMV4/omv_boardconfig.mk @@ -12,6 +12,7 @@ OMV_HSE_VALUE=12000000 DFU_DEVICE=0x0483:0xdf11 OMV_ENABLE_BL=1 OMV_ENABLE_UVC=1 +MICROPY_PY_SENSOR = 1 MICROPY_PY_ULAB = 1 MICROPY_PY_WINC1500 = 1 MICROPY_PY_IMU = 1 diff --git a/src/omv/boards/OPENMV4P/omv_boardconfig.mk b/src/omv/boards/OPENMV4P/omv_boardconfig.mk index b31d25722..2df6b5893 100755 --- a/src/omv/boards/OPENMV4P/omv_boardconfig.mk +++ b/src/omv/boards/OPENMV4P/omv_boardconfig.mk @@ -12,5 +12,6 @@ OMV_HSE_VALUE=12000000 DFU_DEVICE=0x0483:0xdf11 OMV_ENABLE_BL=1 OMV_ENABLE_UVC=1 +MICROPY_PY_SENSOR = 1 MICROPY_PY_ULAB = 1 MICROPY_PY_WINC1500 = 1 diff --git a/src/omv/boards/OPENMVPT/omv_boardconfig.mk b/src/omv/boards/OPENMVPT/omv_boardconfig.mk index b31d25722..2df6b5893 100755 --- a/src/omv/boards/OPENMVPT/omv_boardconfig.mk +++ b/src/omv/boards/OPENMVPT/omv_boardconfig.mk @@ -12,5 +12,6 @@ OMV_HSE_VALUE=12000000 DFU_DEVICE=0x0483:0xdf11 OMV_ENABLE_BL=1 OMV_ENABLE_UVC=1 +MICROPY_PY_SENSOR = 1 MICROPY_PY_ULAB = 1 MICROPY_PY_WINC1500 = 1 diff --git a/src/omv/boards/PORTENTA/omv_boardconfig.mk b/src/omv/boards/PORTENTA/omv_boardconfig.mk index 18897ee98..0d9666e0b 100755 --- a/src/omv/boards/PORTENTA/omv_boardconfig.mk +++ b/src/omv/boards/PORTENTA/omv_boardconfig.mk @@ -13,6 +13,7 @@ DFU_DEVICE=0x2341:0x035b OMV_BOARD_EXTRA_CFLAGS = -DCORE_CM7 OMV_ENABLE_BL=0 OMV_ENABLE_UVC=1 +MICROPY_PY_SENSOR = 1 MICROPY_PY_ULAB = 1 MICROPY_PY_WINC1500 = 0 MICROPY_PY_LWIP = 1 diff --git a/src/omv/modules/py_sensor.c b/src/omv/modules/py_sensor.c index 53e1ac286..82d293dc1 100644 --- a/src/omv/modules/py_sensor.c +++ b/src/omv/modules/py_sensor.c @@ -12,6 +12,9 @@ #include "py/mphal.h" #include "py/nlr.h" #include "pin.h" + +#if MICROPY_PY_SENSOR + #include "sensor.h" #include "imlib.h" #include "xalloc.h" @@ -927,3 +930,4 @@ const mp_obj_module_t sensor_module = { .base = { &mp_type_module }, .globals = (mp_obj_t)&globals_dict, }; +#endif //MICROPY_PY_SENSOR diff --git a/src/omv/ports/stm32/omv_port.mk b/src/omv/ports/stm32/omv_port.mk index c18f46a8d..340bbb98b 100644 --- a/src/omv/ports/stm32/omv_port.mk +++ b/src/omv/ports/stm32/omv_port.mk @@ -32,6 +32,10 @@ MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/ports/stm32/lwip_inc/ # in MicroPython's Makefile, to enable or disable compiling additional modules. MICROPY_ARGS = BOARD=$(TARGET) DEBUG=$(DEBUG) QSTR_DEFS="$(OMV_QSTR_DEFS)" MPY_LIB_DIR=$(MPY_LIB_DIR) +ifeq ($(MICROPY_PY_SENSOR), 1) +MPY_CFLAGS += -DMICROPY_PY_SENSOR=1 +MICROPY_ARGS += MICROPY_PY_SENSOR=1 +endif ifeq ($(MICROPY_PY_WINC1500), 1) MPY_CFLAGS += -DMICROPY_PY_WINC1500=1 MICROPY_ARGS += MICROPY_PY_WINC1500=1