forked from scottalford75/Remora-RP2040-W5500
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
105 lines (79 loc) · 2.49 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
# CMake minimum required version
cmake_minimum_required(VERSION 3.12)
# Include cmake import file
include(pico_sdk_import.cmake)
include(pico_extras_import_optional.cmake)
project(Remora-RP2040-W5500)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
set(PICO_COPY_TO_RAM 1)
#set(PICO_DEOPTIMIZED_DEBUG 1)
# Initialize the SDK
pico_sdk_init()
## Wiznet stuff
# Set ethernet chip
set(WIZNET_CHIP W5500)
if(${WIZNET_CHIP} STREQUAL W5100S)
add_definitions(-D_WIZCHIP_=W5100S)
elseif(${WIZNET_CHIP} STREQUAL W5500)
add_definitions(-D_WIZCHIP_=W5500)
else()
message(FATAL_ERROR "WIZNET_CHIP is wrong = ${WIZNET_CHIP}")
endif()
if(NOT DEFINED WIZNET_DIR)
set(WIZNET_DIR ${CMAKE_SOURCE_DIR}/libraries/ioLibrary_Driver)
message(STATUS "WIZNET_DIR = ${WIZNET_DIR}")
endif()
if(NOT DEFINED PORT_DIR)
set(PORT_DIR ${CMAKE_SOURCE_DIR}/port)
message(STATUS "PORT_DIR = ${PORT_DIR}")
endif()
## end Wiznet stuff
# LWIP
set(LWIP_PATH ${PICO_SDK_PATH}/lib/lwip)
target_include_directories(pico_lwip INTERFACE
${PORT_DIR}/lwip
)
# Add libraries in subdirectories
add_subdirectory(${CMAKE_SOURCE_DIR}/libraries)
add_subdirectory(${PORT_DIR})
include_directories(
#${CMAKE_SOURCE_DIR}/interrupt
)
add_executable(remora
remora.cpp
tftpserver.cpp
#boardconfig.cpp
${CMAKE_SOURCE_DIR}/interrupt/interrupt.cpp
${CMAKE_SOURCE_DIR}/thread/timerInterrupt.cpp
${CMAKE_SOURCE_DIR}/thread/timer.cpp
${CMAKE_SOURCE_DIR}/thread/pruThread.cpp
${CMAKE_SOURCE_DIR}/drivers/pin/pin.cpp
${CMAKE_SOURCE_DIR}/modules/module.cpp
${CMAKE_SOURCE_DIR}/modules/moduleInterrupt.cpp
${CMAKE_SOURCE_DIR}/modules/comms/RemoraComms.cpp
${CMAKE_SOURCE_DIR}/modules/debug/debug.cpp
${CMAKE_SOURCE_DIR}/modules/blink/blink.cpp
${CMAKE_SOURCE_DIR}/modules/stepgen/stepgen.cpp
${CMAKE_SOURCE_DIR}/modules/digitalPin/digitalPin.cpp
)
target_include_directories(remora PUBLIC
${LWIP_PATH}/src/include
# ${CMAKE_SOURCE_DIR}/interrupt
)
target_link_libraries(remora
pico_stdlib
pico_multicore
hardware_spi
hardware_dma
hardware_pwm
hardware_flash
hardware_sync
ETHERNET_FILES
IOLIBRARY_FILES
LWIP_FILES
)
# disable usb output, enable uart output
pico_enable_stdio_usb(remora 0)
pico_enable_stdio_uart(remora 1)
pico_add_extra_outputs(remora)