mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-13 19:19:18 +00:00
get all device example build with rp2040 (except freeRTOS)
This commit is contained in:
parent
ec458292fe
commit
83614418b5
@ -27,6 +27,11 @@ if(FAMILY STREQUAL "rp2040")
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
|
@ -31,6 +31,11 @@ elseif(FAMILY STREQUAL "rp2040")
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
|
@ -27,6 +27,11 @@ if(FAMILY STREQUAL "rp2040")
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
|
@ -33,6 +33,11 @@ elseif(FAMILY STREQUAL "rp2040")
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
|
@ -27,6 +27,11 @@ if(FAMILY STREQUAL "rp2040")
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
|
@ -28,6 +28,11 @@ if(FAMILY STREQUAL "rp2040")
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
|
@ -27,6 +27,11 @@ if(FAMILY STREQUAL "rp2040")
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
|
40
examples/device/hid_generic_inout/CMakeLists.txt
Normal file
40
examples/device/hid_generic_inout/CMakeLists.txt
Normal file
@ -0,0 +1,40 @@
|
||||
# use directory name for project id
|
||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
|
||||
# Check for -DFAMILY=
|
||||
if(FAMILY STREQUAL "rp2040")
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
|
||||
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
|
||||
project(${PROJECT})
|
||||
pico_sdk_init()
|
||||
add_executable(${PROJECT})
|
||||
|
||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid FAMILY specified")
|
||||
endif()
|
@ -64,8 +64,9 @@
|
||||
#error "Incorrect RHPort configuration"
|
||||
#endif
|
||||
|
||||
// This example doesn't use an RTOS
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
40
examples/device/hid_multiple_interface/CMakeLists.txt
Normal file
40
examples/device/hid_multiple_interface/CMakeLists.txt
Normal file
@ -0,0 +1,40 @@
|
||||
# use directory name for project id
|
||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
|
||||
# Check for -DFAMILY=
|
||||
if(FAMILY STREQUAL "rp2040")
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
|
||||
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
|
||||
project(${PROJECT})
|
||||
pico_sdk_init()
|
||||
add_executable(${PROJECT})
|
||||
|
||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid FAMILY specified")
|
||||
endif()
|
@ -64,8 +64,9 @@
|
||||
#error "Incorrect RHPort configuration"
|
||||
#endif
|
||||
|
||||
// This example doesn't use an RTOS
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
40
examples/device/midi_test/CMakeLists.txt
Normal file
40
examples/device/midi_test/CMakeLists.txt
Normal file
@ -0,0 +1,40 @@
|
||||
# use directory name for project id
|
||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
|
||||
# Check for -DFAMILY=
|
||||
if(FAMILY STREQUAL "rp2040")
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
|
||||
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
|
||||
project(${PROJECT})
|
||||
pico_sdk_init()
|
||||
add_executable(${PROJECT})
|
||||
|
||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid FAMILY specified")
|
||||
endif()
|
@ -64,8 +64,9 @@
|
||||
#error "Incorrect RHPort configuration"
|
||||
#endif
|
||||
|
||||
// This example doesn't use an RTOS
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
41
examples/device/msc_dual_lun/CMakeLists.txt
Normal file
41
examples/device/msc_dual_lun/CMakeLists.txt
Normal file
@ -0,0 +1,41 @@
|
||||
# use directory name for project id
|
||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
|
||||
# Check for -DFAMILY=
|
||||
if(FAMILY STREQUAL "rp2040")
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
|
||||
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
|
||||
project(${PROJECT})
|
||||
pico_sdk_init()
|
||||
add_executable(${PROJECT})
|
||||
|
||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk_dual.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid FAMILY specified")
|
||||
endif()
|
@ -64,8 +64,9 @@
|
||||
#error "Incorrect RHPort configuration"
|
||||
#endif
|
||||
|
||||
// This example doesn't use an RTOS
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
87
examples/device/net_lwip_webserver/CMakeLists.txt
Normal file
87
examples/device/net_lwip_webserver/CMakeLists.txt
Normal file
@ -0,0 +1,87 @@
|
||||
# use directory name for project id
|
||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
|
||||
# Check for -DFAMILY=
|
||||
if(FAMILY STREQUAL "rp2040")
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
|
||||
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
|
||||
project(${PROJECT})
|
||||
pico_sdk_init()
|
||||
add_executable(${PROJECT})
|
||||
|
||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
||||
|
||||
# lwip Stack source
|
||||
set(SRC_LWIP
|
||||
${TOP}/lib/lwip/src/core/altcp.c
|
||||
${TOP}/lib/lwip/src/core/altcp_alloc.c
|
||||
${TOP}/lib/lwip/src/core/altcp_tcp.c
|
||||
${TOP}/lib/lwip/src/core/def.c
|
||||
${TOP}/lib/lwip/src/core/dns.c
|
||||
${TOP}/lib/lwip/src/core/inet_chksum.c
|
||||
${TOP}/lib/lwip/src/core/init.c
|
||||
${TOP}/lib/lwip/src/core/ip.c
|
||||
${TOP}/lib/lwip/src/core/mem.c
|
||||
${TOP}/lib/lwip/src/core/memp.c
|
||||
${TOP}/lib/lwip/src/core/netif.c
|
||||
${TOP}/lib/lwip/src/core/pbuf.c
|
||||
${TOP}/lib/lwip/src/core/raw.c
|
||||
${TOP}/lib/lwip/src/core/stats.c
|
||||
${TOP}/lib/lwip/src/core/sys.c
|
||||
${TOP}/lib/lwip/src/core/tcp.c
|
||||
${TOP}/lib/lwip/src/core/tcp_in.c
|
||||
${TOP}/lib/lwip/src/core/tcp_out.c
|
||||
${TOP}/lib/lwip/src/core/timeouts.c
|
||||
${TOP}/lib/lwip/src/core/udp.c
|
||||
${TOP}/lib/lwip/src/core/ipv4/autoip.c
|
||||
${TOP}/lib/lwip/src/core/ipv4/dhcp.c
|
||||
${TOP}/lib/lwip/src/core/ipv4/etharp.c
|
||||
${TOP}/lib/lwip/src/core/ipv4/icmp.c
|
||||
${TOP}/lib/lwip/src/core/ipv4/igmp.c
|
||||
${TOP}/lib/lwip/src/core/ipv4/ip4.c
|
||||
${TOP}/lib/lwip/src/core/ipv4/ip4_addr.c
|
||||
${TOP}/lib/lwip/src/core/ipv4/ip4_frag.c
|
||||
${TOP}/lib/lwip/src/netif/ethernet.c
|
||||
${TOP}/lib/lwip/src/netif/slipif.c
|
||||
${TOP}/lib/lwip/src/apps/http/httpd.c
|
||||
${TOP}/lib/lwip/src/apps/http/fs.c
|
||||
${TOP}/lib/networking/dhserver.c
|
||||
${TOP}/lib/networking/dnserver.c
|
||||
${TOP}/lib/networking/rndis_reports.c
|
||||
)
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
${SRC_LWIP}
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
${TOP}/lib/lwip/src/include
|
||||
${TOP}/lib/lwip/src/include/ipv4
|
||||
${TOP}/lib/lwip/src/include/lwip/apps
|
||||
${TOP}/lib/networking
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
PBUF_POOL_SIZE=2
|
||||
TCP_WND=2*TCP_MSS
|
||||
HTTPD_USE_CUSTOM_FSDATA=0
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid FAMILY specified")
|
||||
endif()
|
@ -64,8 +64,9 @@
|
||||
#error "Incorrect RHPort configuration"
|
||||
#endif
|
||||
|
||||
// This example doesn't use an RTOS
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
40
examples/device/uac2_headset/CMakeLists.txt
Normal file
40
examples/device/uac2_headset/CMakeLists.txt
Normal file
@ -0,0 +1,40 @@
|
||||
# use directory name for project id
|
||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
|
||||
# Check for -DFAMILY=
|
||||
if(FAMILY STREQUAL "rp2040")
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
|
||||
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
|
||||
project(${PROJECT})
|
||||
pico_sdk_init()
|
||||
add_executable(${PROJECT})
|
||||
|
||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid FAMILY specified")
|
||||
endif()
|
@ -46,7 +46,9 @@ extern "C" {
|
||||
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
|
||||
#endif
|
||||
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
#ifndef CFG_TUSB_DEBUG
|
||||
// Can be set during compilation i.e.: make LOG=<value for CFG_TUSB_DEBUG> BOARD=<bsp>
|
||||
|
41
examples/device/usbtmc/CMakeLists.txt
Normal file
41
examples/device/usbtmc/CMakeLists.txt
Normal file
@ -0,0 +1,41 @@
|
||||
# use directory name for project id
|
||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
|
||||
# Check for -DFAMILY=
|
||||
if(FAMILY STREQUAL "rp2040")
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
|
||||
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
|
||||
project(${PROJECT})
|
||||
pico_sdk_init()
|
||||
add_executable(${PROJECT})
|
||||
|
||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usbtmc_app.c
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid FAMILY specified")
|
||||
endif()
|
@ -46,8 +46,9 @@
|
||||
#error "Incorrect RHPort configuration"
|
||||
#endif
|
||||
|
||||
// This example doesn't use an RTOS
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
40
examples/device/webusb_serial/CMakeLists.txt
Normal file
40
examples/device/webusb_serial/CMakeLists.txt
Normal file
@ -0,0 +1,40 @@
|
||||
# use directory name for project id
|
||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
|
||||
# Check for -DFAMILY=
|
||||
if(FAMILY STREQUAL "rp2040")
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
|
||||
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
|
||||
project(${PROJECT})
|
||||
pico_sdk_init()
|
||||
add_executable(${PROJECT})
|
||||
|
||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Example defines
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT} pico_stdlib)
|
||||
pico_add_extra_outputs(${PROJECT})
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid FAMILY specified")
|
||||
endif()
|
@ -64,8 +64,9 @@
|
||||
#error "Incorrect RHPort configuration"
|
||||
#endif
|
||||
|
||||
// This example doesn't use an RTOS
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
@ -45,7 +45,9 @@
|
||||
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_HOST
|
||||
#endif
|
||||
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
@ -30,5 +30,4 @@ target_include_directories(${PROJECT} PUBLIC
|
||||
|
||||
target_compile_definitions(${PROJECT} PUBLIC
|
||||
CFG_TUSB_MCU=OPT_MCU_RP2040
|
||||
CFG_TUSB_OS=OPT_OS_PICO
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user