-
Notifications
You must be signed in to change notification settings - Fork 42
/
CMakeLists.txt
55 lines (43 loc) · 1.43 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
cmake_minimum_required(VERSION 3.13)
set(PICO_BOARD pico_w)
include(pico_sdk_import.cmake)
project(picomemcard_project C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
pico_sdk_init()
add_executable(PicoMemcard)
pico_set_linker_script(PicoMemcard ${CMAKE_SOURCE_DIR}/memmap.ld)
pico_generate_pio_header(PicoMemcard ${CMAKE_CURRENT_LIST_DIR}/psxSPI.pio)
pico_generate_pio_header(PicoMemcard ${CMAKE_CURRENT_LIST_DIR}/ws2812.pio)
add_definitions(-DNO_PICO_LED) # prevent SD SPI library from using LED
add_subdirectory(no-OS-FatFS-SD-SPI-RPi-Pico/FatFs_SPI PicoMemcard)
add_subdirectory(poc_examples)
# Example source
target_sources(PicoMemcard PUBLIC
${CMAKE_SOURCE_DIR}/src/led.c
${CMAKE_SOURCE_DIR}/src/main.c
${CMAKE_SOURCE_DIR}/src/memcard_manager.c
${CMAKE_SOURCE_DIR}/src/memcard_simulator.c
${CMAKE_SOURCE_DIR}/src/memory_card.c
${CMAKE_SOURCE_DIR}/src/msc_handler.c
${CMAKE_SOURCE_DIR}/src/sd_config.c
${CMAKE_SOURCE_DIR}/src/usb_descriptors.c
)
# Example include
target_include_directories(PicoMemcard PUBLIC
${CMAKE_SOURCE_DIR}/inc
)
pico_enable_stdio_uart(PicoMemcard 1) # enable only UART stdio
target_link_libraries(
PicoMemcard
pico_stdlib
pico_multicore
pico_time
hardware_pio
tinyusb_device
tinyusb_board
FatFs_SPI
pico_cyw43_arch_none # If you do not need the TCP/IP stack but wish to use the on-board LED on a Pico W
hardware_adc
)
pico_add_extra_outputs(PicoMemcard)