blob: 77afb15839d9d025758a8def9b30527cbd4fb091 (
plain)
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
|
# Set minimum required version of CMake
cmake_minimum_required(VERSION 3.12)
set (PICO_SDK_PATH "../pico-sdk")
# Include build functions from Pico SDK
include(pico-sdk/external/pico_sdk_import.cmake)
# Set name of project (as PROJECT_NAME) and C/C++ standards
project(m1_ubmc C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# Creates a pico-sdk subdirectory in our project for the libraries
pico_sdk_init()
# Tell CMake where to find the executable source file
add_executable(${PROJECT_NAME}
start.c
FUSB302.c
tcpm_driver.c
vdmtool.c
usb_descriptors.c
)
target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}
)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -funsigned-char)
# Create map/bin/hex/uf2 files
pico_add_extra_outputs(${PROJECT_NAME})
# Link to pico_stdlib (gpio, time, etc. functions)
target_link_libraries(${PROJECT_NAME}
pico_stdlib
hardware_i2c
pico_unique_id
tinyusb_board
tinyusb_device
)
install(CODE "execute_process(COMMAND bash -c \"mount /dev/disk/by-id/usb-RPI_RP2_E0C9125B0D9B-0\:0-part1 /mnt && cp ./${PROJECT_NAME}.uf2 /mnt/ && eject /mnt\")")
#pico_set_binary_type(${PROJECT_NAME} no_flash)
|