This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
103 lines (78 loc) · 2.6 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
cmake_minimum_required(VERSION 3.13)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(PICO_SDK_PATH "../lib/pico-sdk")
set(PICO_EXTRAS_PATH "../lib/pico-extras")
# Pull in Raspberry Pi Pico SDK (must be before project)
include(cmake/pico_sdk_import.cmake)
include(cmake/pico_extras_import.cmake)
# set(PICO_BOARD datanoisetv_rp2040_dsp)
set(FREERTOS_SRC_DIRECTORY "${PICO_SDK_PATH}/lib/tinyusb/lib/FreeRTOS-Kernel")
add_library(FreeRTOS STATIC
${FREERTOS_SRC_DIRECTORY}/event_groups.c
${FREERTOS_SRC_DIRECTORY}/list.c
${FREERTOS_SRC_DIRECTORY}/queue.c
${FREERTOS_SRC_DIRECTORY}/stream_buffer.c
${FREERTOS_SRC_DIRECTORY}/tasks.c
${FREERTOS_SRC_DIRECTORY}/timers.c
${FREERTOS_SRC_DIRECTORY}/portable/MemMang/heap_3.c
${FREERTOS_SRC_DIRECTORY}/portable/GCC/ARM_CM0/port.c
)
target_include_directories(FreeRTOS PUBLIC
${FREERTOS_CFG_DIRECTORY}/
${FREERTOS_SRC_DIRECTORY}/include
${FREERTOS_SRC_DIRECTORY}/portable/GCC/ARM_CM0
)
project(main C CXX ASM)
# set(PICO_CXX_ENABLE_EXCEPTIONS 1)
# Initialise the Raspberry Pi Pico SDK
pico_sdk_init()
# Add executable. Default name is the project name, version 0.1
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR} ".")
# add_subdirectory(lib/audio)
add_executable(main
src/freertos_utils.cpp
src/main.cpp
)
add_subdirectory(lib/oled_ssd1306)
pico_set_program_name(main "main")
pico_set_program_version(main "0.1")
pico_enable_stdio_uart(main 1)
pico_enable_stdio_usb(main 0)
# Add the standard library to the build
target_link_libraries(main pico_stdlib)
# Add any user requested libraries
target_link_libraries(main
hardware_adc
hardware_spi
hardware_i2c
hardware_dma
hardware_pio
hardware_irq
hardware_interp
hardware_timer
hardware_watchdog
hardware_clocks
pico_bootsel_via_double_reset
pico_util_buffer
pico_multicore
#pico_stdio_uart
#tinyusb_device
#tinyusb_board
#oled_ssd1306
FreeRTOS
)
target_compile_definitions(main PRIVATE
USE_AUDIO_I2S=1
#PICO_DEFAULT_UART_BAUD_RATE=921600
)
file(GLOB files "${CMAKE_CURRENT_LIST_DIR}/piosrc/*.pio")
foreach(file ${files})
message ("Adding ${file}")
pico_generate_pio_header(main ${file})
endforeach()
# Enable this if overclocking > 200MHz is required
#pico_define_boot_stage2(slower_boot2 ${PICO_DEFAULT_BOOT_STAGE2_FILE})
#target_compile_definitions(slower_boot2 PRIVATE PICO_FLASH_SPI_CLKDIV=4)
#pico_set_boot_stage2(main slower_boot2)
pico_add_extra_outputs(main)