Merge pull request #1051 from openmv/sensor_module

Make py sensor module configurable.
This commit is contained in:
Ibrahim Abd Elkader 2020-12-24 23:54:46 +02:00 committed by GitHub
commit 6e3fa2ba98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 31 additions and 1 deletions

@ -1 +1 @@
Subproject commit 8e0531df1397cee56c6d9d18f8af2220fa4c3d1f Subproject commit 7a39d799900826ff07bb427633a8ad857e6afe42

View File

@ -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

View File

@ -12,5 +12,6 @@ OMV_HSE_VALUE=12000000
DFU_DEVICE=0x0483:0xdf11 DFU_DEVICE=0x0483:0xdf11
OMV_ENABLE_BL=1 OMV_ENABLE_BL=1
OMV_ENABLE_UVC=1 OMV_ENABLE_UVC=1
MICROPY_PY_SENSOR = 1
MICROPY_PY_WINC1500 = 1 MICROPY_PY_WINC1500 = 1
$(error "This camera is no longer supported :O Have fun hacking the code $(BRACKET)") $(error "This camera is no longer supported :O Have fun hacking the code $(BRACKET)")

View File

@ -12,4 +12,5 @@ OMV_HSE_VALUE=12000000
DFU_DEVICE=0x0483:0xdf11 DFU_DEVICE=0x0483:0xdf11
OMV_ENABLE_BL=1 OMV_ENABLE_BL=1
OMV_ENABLE_UVC=1 OMV_ENABLE_UVC=1
MICROPY_PY_SENSOR = 1
MICROPY_PY_WINC1500 = 1 MICROPY_PY_WINC1500 = 1

View File

@ -12,5 +12,6 @@ OMV_HSE_VALUE=12000000
DFU_DEVICE=0x0483:0xdf11 DFU_DEVICE=0x0483:0xdf11
OMV_ENABLE_BL=1 OMV_ENABLE_BL=1
OMV_ENABLE_UVC=1 OMV_ENABLE_UVC=1
MICROPY_PY_SENSOR = 1
MICROPY_PY_ULAB = 1 MICROPY_PY_ULAB = 1
MICROPY_PY_WINC1500 = 1 MICROPY_PY_WINC1500 = 1

View File

@ -12,6 +12,7 @@ OMV_HSE_VALUE=12000000
DFU_DEVICE=0x0483:0xdf11 DFU_DEVICE=0x0483:0xdf11
OMV_ENABLE_BL=1 OMV_ENABLE_BL=1
OMV_ENABLE_UVC=1 OMV_ENABLE_UVC=1
MICROPY_PY_SENSOR = 1
MICROPY_PY_ULAB = 1 MICROPY_PY_ULAB = 1
MICROPY_PY_WINC1500 = 1 MICROPY_PY_WINC1500 = 1
MICROPY_PY_IMU = 1 MICROPY_PY_IMU = 1

View File

@ -12,5 +12,6 @@ OMV_HSE_VALUE=12000000
DFU_DEVICE=0x0483:0xdf11 DFU_DEVICE=0x0483:0xdf11
OMV_ENABLE_BL=1 OMV_ENABLE_BL=1
OMV_ENABLE_UVC=1 OMV_ENABLE_UVC=1
MICROPY_PY_SENSOR = 1
MICROPY_PY_ULAB = 1 MICROPY_PY_ULAB = 1
MICROPY_PY_WINC1500 = 1 MICROPY_PY_WINC1500 = 1

View File

@ -12,5 +12,6 @@ OMV_HSE_VALUE=12000000
DFU_DEVICE=0x0483:0xdf11 DFU_DEVICE=0x0483:0xdf11
OMV_ENABLE_BL=1 OMV_ENABLE_BL=1
OMV_ENABLE_UVC=1 OMV_ENABLE_UVC=1
MICROPY_PY_SENSOR = 1
MICROPY_PY_ULAB = 1 MICROPY_PY_ULAB = 1
MICROPY_PY_WINC1500 = 1 MICROPY_PY_WINC1500 = 1

View File

@ -13,6 +13,7 @@ DFU_DEVICE=0x2341:0x035b
OMV_BOARD_EXTRA_CFLAGS = -DCORE_CM7 OMV_BOARD_EXTRA_CFLAGS = -DCORE_CM7
OMV_ENABLE_BL=0 OMV_ENABLE_BL=0
OMV_ENABLE_UVC=1 OMV_ENABLE_UVC=1
MICROPY_PY_SENSOR = 1
MICROPY_PY_ULAB = 1 MICROPY_PY_ULAB = 1
MICROPY_PY_WINC1500 = 0 MICROPY_PY_WINC1500 = 0
MICROPY_PY_LWIP = 1 MICROPY_PY_LWIP = 1

View File

@ -12,6 +12,9 @@
#include "py/mphal.h" #include "py/mphal.h"
#include "py/nlr.h" #include "py/nlr.h"
#include "pin.h" #include "pin.h"
#if MICROPY_PY_SENSOR
#include "sensor.h" #include "sensor.h"
#include "imlib.h" #include "imlib.h"
#include "xalloc.h" #include "xalloc.h"
@ -927,3 +930,4 @@ const mp_obj_module_t sensor_module = {
.base = { &mp_type_module }, .base = { &mp_type_module },
.globals = (mp_obj_t)&globals_dict, .globals = (mp_obj_t)&globals_dict,
}; };
#endif //MICROPY_PY_SENSOR

View File

@ -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. # 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) 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) ifeq ($(MICROPY_PY_WINC1500), 1)
MPY_CFLAGS += -DMICROPY_PY_WINC1500=1 MPY_CFLAGS += -DMICROPY_PY_WINC1500=1
MICROPY_ARGS += MICROPY_PY_WINC1500=1 MICROPY_ARGS += MICROPY_PY_WINC1500=1