-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmicropython.cmake
More file actions
75 lines (60 loc) · 2.36 KB
/
Copy pathmicropython.cmake
File metadata and controls
75 lines (60 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# MicroPython CMake glue for displayif (ESP32, RP2, …).
#
# Point USER_C_MODULES at this repo directly, e.g.:
# idf.py build -DUSER_C_MODULES=/path/to/displayif/micropython.cmake
# usermod.cmake also accepts a semicolon-separated list of module paths if you
# want displayif plus other modules — no aggregator file required, e.g.:
# -DUSER_C_MODULES="/path/to/displayif;/path/to/other_mod"
# Hardware interfaces build only on MCU ports — not unix, windows, etc.
set(DISPLAYIF_MOD_DIR ${CMAKE_CURRENT_LIST_DIR})
get_filename_component(_DISPLAYIF_PORT_DIR "${MICROPY_PORT_DIR}" ABSOLUTE)
set(DISPLAYIF_PORT_ESP32 FALSE)
set(DISPLAYIF_PORT_MIMXRT FALSE)
set(DISPLAYIF_PORT_SAMD FALSE)
set(DISPLAYIF_PORT_RP2 FALSE)
set(DISPLAYIF_PORT_STM32 FALSE)
if(_DISPLAYIF_PORT_DIR MATCHES "/ports/esp32")
set(DISPLAYIF_PORT_ESP32 TRUE)
elseif(_DISPLAYIF_PORT_DIR MATCHES "/ports/mimxrt")
set(DISPLAYIF_PORT_MIMXRT TRUE)
elseif(_DISPLAYIF_PORT_DIR MATCHES "/ports/samd")
set(DISPLAYIF_PORT_SAMD TRUE)
elseif(_DISPLAYIF_PORT_DIR MATCHES "/ports/rp2")
set(DISPLAYIF_PORT_RP2 TRUE)
elseif(_DISPLAYIF_PORT_DIR MATCHES "/ports/stm32")
set(DISPLAYIF_PORT_STM32 TRUE)
endif()
set(DISPLAYIF_IS_MCU FALSE)
if(DISPLAYIF_PORT_ESP32 OR DISPLAYIF_PORT_MIMXRT OR DISPLAYIF_PORT_SAMD OR DISPLAYIF_PORT_RP2 OR DISPLAYIF_PORT_STM32)
set(DISPLAYIF_IS_MCU TRUE)
endif()
if(DISPLAYIF_PORT_ESP32 AND CONFIG_IDF_TARGET_ESP32S3)
set(DISPLAYIF_RGBMATRIX_USE_PROTOMATTER TRUE)
endif()
if(DISPLAYIF_PORT_MIMXRT AND BOARD MATCHES "TEENSY4.*|MIMXRT1060_EVK")
set(DISPLAYIF_RGBMATRIX_USE_PROTOMATTER TRUE)
endif()
if(DISPLAYIF_PORT_SAMD AND MCU_SERIES MATCHES "SAMD51")
set(DISPLAYIF_RGBMATRIX_USE_PROTOMATTER TRUE)
endif()
if(DISPLAYIF_PORT_RP2)
set(DISPLAYIF_RGBMATRIX_USE_PROTOMATTER TRUE)
endif()
if(DISPLAYIF_IS_MCU)
include(${DISPLAYIF_MOD_DIR}/src/ports/common/micropython.cmake)
endif()
if(DISPLAYIF_PORT_ESP32)
include(${DISPLAYIF_MOD_DIR}/src/ports/esp32/micropython.cmake)
endif()
if(DISPLAYIF_PORT_MIMXRT)
include(${DISPLAYIF_MOD_DIR}/src/ports/mimxrt/micropython.cmake)
endif()
if(DISPLAYIF_PORT_SAMD)
include(${DISPLAYIF_MOD_DIR}/src/ports/samd/micropython.cmake)
endif()
if(DISPLAYIF_PORT_RP2)
include(${DISPLAYIF_MOD_DIR}/src/ports/rp2/micropython.cmake)
endif()
if(DISPLAYIF_PORT_STM32)
include(${DISPLAYIF_MOD_DIR}/src/ports/stm32/micropython.cmake)
endif()