diff --git a/src/Makefile b/src/Makefile index c52e623de..d500e14fb 100755 --- a/src/Makefile +++ b/src/Makefile @@ -142,6 +142,16 @@ MPY_CFLAGS += -DMICROPY_PY_MICRO_SPEECH=1 MICROPY_ARGS += MICROPY_PY_MICRO_SPEECH=1 endif +ifeq ($(MICROPY_PY_LCD), 1) +MPY_CFLAGS += -DMICROPY_PY_LCD=1 +MICROPY_ARGS += MICROPY_PY_LCD=1 +endif + +ifeq ($(MICROPY_PY_TV), 1) +MPY_CFLAGS += -DMICROPY_PY_TV=1 +MICROPY_ARGS += MICROPY_PY_TV=1 +endif + # Include the port Makefile. include $(OMV_DIR)/ports/$(PORT)/omv_portconfig.mk diff --git a/src/micropython b/src/micropython index 338e3f91c..e5d4238a4 160000 --- a/src/micropython +++ b/src/micropython @@ -1 +1 @@ -Subproject commit 338e3f91cf96c105c683eb0dbf9c990d74e85728 +Subproject commit e5d4238a436a2a0d57fd7c7820eab49c3b2185c4 diff --git a/src/omv/boards/BORMIO/omv_boardconfig.mk b/src/omv/boards/BORMIO/omv_boardconfig.mk index 01cce8f49..5ffa6600a 100755 --- a/src/omv/boards/BORMIO/omv_boardconfig.mk +++ b/src/omv/boards/BORMIO/omv_boardconfig.mk @@ -21,3 +21,5 @@ MICROPY_PY_LWIP = 1 MICROPY_PY_NETWORK_CYW43 = 1 MICROPY_PY_AUDIO = 0 MICROPY_PY_MICRO_SPEECH = 0 +MICROPY_PY_LCD = 1 +MICROPY_PY_TV = 1 diff --git a/src/omv/boards/NANO33/omv_boardconfig.mk b/src/omv/boards/NANO33/omv_boardconfig.mk index 3a9d6bad1..3c4be3ae1 100755 --- a/src/omv/boards/NANO33/omv_boardconfig.mk +++ b/src/omv/boards/NANO33/omv_boardconfig.mk @@ -14,3 +14,5 @@ OMV_HSE_VALUE=12000000 DFU_DEVICE=0x0483:0xdf11 MICROPY_PY_ULAB=1 MICROPY_PY_AUDIO=1 +MICROPY_PY_LCD = 0 +MICROPY_PY_TV = 0 diff --git a/src/omv/boards/OPENMV2/omv_boardconfig.mk b/src/omv/boards/OPENMV2/omv_boardconfig.mk index b1e99d126..d435a0544 100755 --- a/src/omv/boards/OPENMV2/omv_boardconfig.mk +++ b/src/omv/boards/OPENMV2/omv_boardconfig.mk @@ -14,3 +14,5 @@ OMV_ENABLE_BL=1 OMV_ENABLE_UVC=1 MICROPY_PY_SENSOR = 1 MICROPY_PY_WINC1500 = 1 +MICROPY_PY_LCD = 1 +MICROPY_PY_TV = 1 diff --git a/src/omv/boards/OPENMV3/omv_boardconfig.mk b/src/omv/boards/OPENMV3/omv_boardconfig.mk index 0cadbe535..886b3b5a8 100755 --- a/src/omv/boards/OPENMV3/omv_boardconfig.mk +++ b/src/omv/boards/OPENMV3/omv_boardconfig.mk @@ -15,3 +15,5 @@ OMV_ENABLE_UVC=1 MICROPY_PY_SENSOR = 1 MICROPY_PY_ULAB = 1 MICROPY_PY_WINC1500 = 1 +MICROPY_PY_LCD = 1 +MICROPY_PY_TV = 1 diff --git a/src/omv/boards/OPENMV4/omv_boardconfig.mk b/src/omv/boards/OPENMV4/omv_boardconfig.mk index d84536fa3..9021546a1 100755 --- a/src/omv/boards/OPENMV4/omv_boardconfig.mk +++ b/src/omv/boards/OPENMV4/omv_boardconfig.mk @@ -16,3 +16,5 @@ MICROPY_PY_SENSOR = 1 MICROPY_PY_ULAB = 1 MICROPY_PY_WINC1500 = 1 MICROPY_PY_IMU = 1 +MICROPY_PY_LCD = 1 +MICROPY_PY_TV = 1 diff --git a/src/omv/boards/OPENMV4P/omv_boardconfig.mk b/src/omv/boards/OPENMV4P/omv_boardconfig.mk index 2df6b5893..73140d409 100755 --- a/src/omv/boards/OPENMV4P/omv_boardconfig.mk +++ b/src/omv/boards/OPENMV4P/omv_boardconfig.mk @@ -15,3 +15,5 @@ OMV_ENABLE_UVC=1 MICROPY_PY_SENSOR = 1 MICROPY_PY_ULAB = 1 MICROPY_PY_WINC1500 = 1 +MICROPY_PY_LCD = 1 +MICROPY_PY_TV = 1 diff --git a/src/omv/boards/OPENMVPT/omv_boardconfig.mk b/src/omv/boards/OPENMVPT/omv_boardconfig.mk index 2df6b5893..73140d409 100755 --- a/src/omv/boards/OPENMVPT/omv_boardconfig.mk +++ b/src/omv/boards/OPENMVPT/omv_boardconfig.mk @@ -15,3 +15,5 @@ OMV_ENABLE_UVC=1 MICROPY_PY_SENSOR = 1 MICROPY_PY_ULAB = 1 MICROPY_PY_WINC1500 = 1 +MICROPY_PY_LCD = 1 +MICROPY_PY_TV = 1 diff --git a/src/omv/boards/PORTENTA/omv_boardconfig.mk b/src/omv/boards/PORTENTA/omv_boardconfig.mk index 0d9666e0b..026fd5ece 100755 --- a/src/omv/boards/PORTENTA/omv_boardconfig.mk +++ b/src/omv/boards/PORTENTA/omv_boardconfig.mk @@ -20,3 +20,5 @@ MICROPY_PY_LWIP = 1 MICROPY_PY_NETWORK_CYW43 = 1 MICROPY_PY_AUDIO = 1 MICROPY_PY_MICRO_SPEECH = 1 +MICROPY_PY_LCD = 1 +MICROPY_PY_TV = 1 diff --git a/src/omv/ports/stm32/modules/py_lcd.c b/src/omv/ports/stm32/modules/py_lcd.c index 85bbf95a4..0b0167ac8 100644 --- a/src/omv/ports/stm32/modules/py_lcd.c +++ b/src/omv/ports/stm32/modules/py_lcd.c @@ -22,6 +22,8 @@ #include "omv_boardconfig.h" #include STM32_HAL_H +#if MICROPY_PY_LCD + #define FRAMEBUFFER_COUNT 3 static int framebuffer_head = 0; static volatile int framebuffer_tail = 0; @@ -1790,3 +1792,5 @@ void py_lcd_init0() { py_lcd_deinit(); } + +#endif // MICROPY_PY_LCD diff --git a/src/omv/ports/stm32/modules/py_lcd_cec.c b/src/omv/ports/stm32/modules/py_lcd_cec.c index 1e314193d..cd8d0a6a8 100644 --- a/src/omv/ports/stm32/modules/py_lcd_cec.c +++ b/src/omv/ports/stm32/modules/py_lcd_cec.c @@ -18,6 +18,8 @@ #include "py_lcd_cec.h" #include "omv_boardconfig.h" +#if MICROPY_PY_LCD + #ifdef OMV_CEC_PRESENT static mp_obj_t lcd_cec_user_cb = NULL; @@ -598,3 +600,5 @@ void lcd_cec_register_cec_receive_cb(mp_obj_t cb, mp_obj_t dst_addr) if (cb != mp_const_none) extint_enable(OMV_CEC_PIN->pin); } #endif // OMV_CEC_PRESENT + +#endif // MICROPY_PY_LCD diff --git a/src/omv/ports/stm32/modules/py_lcd_touch.c b/src/omv/ports/stm32/modules/py_lcd_touch.c index ad6b9641b..5ff27bad9 100644 --- a/src/omv/ports/stm32/modules/py_lcd_touch.c +++ b/src/omv/ports/stm32/modules/py_lcd_touch.c @@ -19,6 +19,8 @@ #include "omv_boardconfig.h" #include STM32_HAL_H +#if MICROPY_PY_LCD + #ifdef OMV_TOUCH_PRESENT #define FT5X06_I2C_ADDR 0x38 static mp_obj_base_t *lcd_touch_bus = NULL; @@ -187,3 +189,5 @@ void lcd_touch_register_touch_cb(mp_obj_t cb) if (cb != mp_const_none) extint_enable(OMV_TOUCH_INT_PIN->pin); } #endif // OMV_TOUCH_PRESENT + +#endif // MICROPY_PY_LCD diff --git a/src/omv/ports/stm32/modules/py_tv.c b/src/omv/ports/stm32/modules/py_tv.c index b2f58b7ac..4c908e71e 100644 --- a/src/omv/ports/stm32/modules/py_tv.c +++ b/src/omv/ports/stm32/modules/py_tv.c @@ -18,6 +18,8 @@ #include "omv_boardconfig.h" #include STM32_HAL_H +#if MICROPY_PY_TV + #define TV_WIDTH 352 #define TV_HEIGHT 240 #define TV_REFRESH 60 @@ -1063,3 +1065,5 @@ void py_tv_init0() { py_tv_deinit(); } + +#endif // MICROPY_PY_TV