forked from pitschu/RP2040matrix-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
179 lines (151 loc) · 5.95 KB
/
CMakeLists.txt
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
cmake_minimum_required(VERSION 3.13)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# initalize pico_sdk from installed location
# (note this can come from environment, CMake cache etc)
set(PICO_SDK_PATH "${CMAKE_SOURCE_DIR}../../pico-sdk")
# set(FREERTOS_KERNEL_PATH "${CMAKE_SOURCE_DIR}../../FreeRTOS-Kernel-SMP")
set(FREERTOS_KERNEL_PATH "${CMAKE_SOURCE_DIR}/../FreeRTOS/FreeRTOS/Source")
# Pull in Raspberry Pi Pico SDK (must be before project)
include(pico_sdk_import.cmake)
# Pull in FreeRTOS
include(FreeRTOS_Kernel_import.cmake)
project(RP2040matrix_Proj C CXX ASM)
# Initialise the Raspberry Pi Pico SDK
pico_sdk_init()
# Add executable. Default name is the project name, version 0.1
add_executable(RP2040matrix
RP2040matrixDemo.c
hub75.c ps_hub75_128.pio ps_hub75_64.pio
gol.c pong.c
LEDmx.c
bmfont.c sensors.c icons/inside.c icons/outside.c icons/winter_garden.c icons/water.c)
pico_generate_pio_header(RP2040matrix ${CMAKE_CURRENT_LIST_DIR}/ps_hub75_128.pio)
pico_generate_pio_header(RP2040matrix ${CMAKE_CURRENT_LIST_DIR}/ps_hub75_64.pio)
pico_enable_stdio_uart(RP2040matrix 0)
pico_enable_stdio_usb(RP2040matrix 1)
target_sources(RP2040matrix PRIVATE RP2040matrixDemo.c)
target_include_directories(RP2040matrix PRIVATE include/
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/../../Common/include)
target_compile_definitions(RP2040matrix PRIVATE
PICO_DEFAULT_UART_TX_PIN=28
PICO_DEFAULT_UART_RX_PIN=29
PCB_LAYOUT_V1=1
HUB75_SIZE=4040 # 4040 = 64x64, other value is 8080 for 128x128 and 8040 for 128x64
)
pico_add_extra_outputs(RP2040matrix)
target_link_libraries(RP2040matrix PRIVATE
hardware_pio
hardware_dma
hardware_i2c
FreeRTOS-Kernel
FreeRTOS-Kernel-Heap1
pico_stdlib
pico_multicore)
add_custom_command(TARGET RP2040matrix
POST_BUILD
COMMAND arm-none-eabi-size -B RP2040matrix.elf)
#########################################################################
add_executable(RP2040matrix_128x64_BCM
RP2040matrixDemo.c
hub75_BCM.c ps_hub75_128_BCM.pio ps_hub75_64_BCM.pio
gol.c pong.c
LEDmx.c
bmfont.c sensors.c icons/inside.c icons/outside.c icons/winter_garden.c icons/water.c)
pico_generate_pio_header(RP2040matrix_128x64_BCM ${CMAKE_CURRENT_LIST_DIR}/ps_hub75_128_BCM.pio)
pico_generate_pio_header(RP2040matrix_128x64_BCM ${CMAKE_CURRENT_LIST_DIR}/ps_hub75_64_BCM.pio)
pico_enable_stdio_uart(RP2040matrix_128x64_BCM 0)
pico_enable_stdio_usb(RP2040matrix_128x64_BCM 1)
target_sources(RP2040matrix_128x64_BCM PRIVATE RP2040matrixDemo.c)
target_include_directories(RP2040matrix_128x64_BCM PRIVATE include/
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/../../Common/include)
target_compile_definitions(RP2040matrix_128x64_BCM PRIVATE
PICO_DEFAULT_UART_TX_PIN=28
PICO_DEFAULT_UART_RX_PIN=29
HUB75_BCM=1
PCB_LAYOUT_V2=1
HUB75_SIZE=8040 # 4040 = 64x64, other value is 8080 for 128x128 and 8040 for 128x64
)
pico_add_extra_outputs(RP2040matrix_128x64_BCM)
target_link_libraries(RP2040matrix_128x64_BCM PRIVATE
hardware_pio
hardware_dma
hardware_i2c
FreeRTOS-Kernel
FreeRTOS-Kernel-Heap1
pico_stdlib
pico_multicore)
add_custom_command(TARGET RP2040matrix_128x64_BCM
POST_BUILD
COMMAND arm-none-eabi-size -B RP2040matrix_128x64_BCM.elf)
#########################################################################
add_executable(RP2040matrix_64_BCM
RP2040matrixDemo.c
hub75_BCM.c ps_hub75_128_BCM.pio ps_hub75_64_BCM.pio
gol.c pong.c
LEDmx.c
bmfont.c sensors.c icons/inside.c icons/outside.c icons/winter_garden.c icons/water.c)
pico_generate_pio_header(RP2040matrix_64_BCM ${CMAKE_CURRENT_LIST_DIR}/ps_hub75_128_BCM.pio)
pico_generate_pio_header(RP2040matrix_64_BCM ${CMAKE_CURRENT_LIST_DIR}/ps_hub75_64_BCM.pio)
pico_enable_stdio_uart(RP2040matrix_64_BCM 0)
pico_enable_stdio_usb(RP2040matrix_64_BCM 1)
target_sources(RP2040matrix_64_BCM PRIVATE RP2040matrixDemo.c)
target_include_directories(RP2040matrix_64_BCM PRIVATE include/
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/../../Common/include)
target_compile_definitions(RP2040matrix_64_BCM PRIVATE
PICO_DEFAULT_UART_TX_PIN=28
PICO_DEFAULT_UART_RX_PIN=29
HUB75_BCM=1
PCB_LAYOUT_V2=1
HUB75_SIZE=4040 # 4040 = 64x64, other value is 8080 for 128x128 and 8040 for 128x64
)
pico_add_extra_outputs(RP2040matrix_64_BCM)
target_link_libraries(RP2040matrix_64_BCM PRIVATE
hardware_pio
hardware_dma
hardware_i2c
FreeRTOS-Kernel
FreeRTOS-Kernel-Heap1
pico_stdlib
pico_multicore)
add_custom_command(TARGET RP2040matrix_64_BCM
POST_BUILD
COMMAND arm-none-eabi-size -B RP2040matrix_64_BCM.elf)
#########################################################################
add_executable(RP2040matrix_128_BCM
RP2040matrixDemo.c
hub75_BCM.c ps_hub75_128_BCM.pio ps_hub75_64_BCM.pio
gol.c pong.c
LEDmx.c
bmfont.c sensors.c icons/inside.c icons/outside.c icons/winter_garden.c icons/water.c)
pico_generate_pio_header(RP2040matrix_128_BCM ${CMAKE_CURRENT_LIST_DIR}/ps_hub75_128_BCM.pio)
pico_generate_pio_header(RP2040matrix_128_BCM ${CMAKE_CURRENT_LIST_DIR}/ps_hub75_64_BCM.pio)
pico_enable_stdio_uart(RP2040matrix_128_BCM 0)
pico_enable_stdio_usb(RP2040matrix_128_BCM 1)
target_sources(RP2040matrix_128_BCM PRIVATE RP2040matrixDemo.c)
target_include_directories(RP2040matrix_128_BCM PRIVATE include/
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/../../Common/include)
target_compile_definitions(RP2040matrix_128_BCM PRIVATE
PICO_DEFAULT_UART_TX_PIN=28
PICO_DEFAULT_UART_RX_PIN=29
HUB75_BCM=1
PCB_LAYOUT_V2=1
HUB75_SIZE=8080 # 4040 = 64x64, other value is 8080 for 128x128 and 8040 for 128x64
)
pico_add_extra_outputs(RP2040matrix_128_BCM)
target_link_libraries(RP2040matrix_128_BCM PRIVATE
hardware_pio
hardware_dma
hardware_i2c
FreeRTOS-Kernel
FreeRTOS-Kernel-Heap1
pico_stdlib
pico_multicore)
add_custom_command(TARGET RP2040matrix_128_BCM
POST_BUILD
COMMAND arm-none-eabi-size -B RP2040matrix_128_BCM.elf
)