Skip to content

Commit

Permalink
Merge pull request #865 from kilograham/pico-0.10.0
Browse files Browse the repository at this point in the history
Pico 0.10.0
  • Loading branch information
hathach authored Jun 2, 2021
2 parents ff1a112 + fea5cba commit 8ea0dfb
Show file tree
Hide file tree
Showing 38 changed files with 827 additions and 946 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Checkout pico-sdk
if: matrix.family == 'rp2040'
run: |
git clone --depth 1 https://github.com/raspberrypi/pico-sdk ~/pico-sdk
git clone --depth 1 -b tinyusb-0.10.0 https://github.com/raspberrypi/pico-sdk ~/pico-sdk
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
- name: Set Toolchain URL
Expand Down
27 changes: 27 additions & 0 deletions examples/device/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.5)

include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/${FAMILY}/family.cmake)

project(tinyusb_device_examples)
family_initialize_project(tinyusb_device_examples ${CMAKE_CURRENT_LIST_DIR})

# family_add_subdirectory will filter what to actually add based on selected FAMILY
family_add_subdirectory(audio_4_channel_mic)
family_add_subdirectory(audio_test)
family_add_subdirectory(board_test)
family_add_subdirectory(cdc_dual_ports)
family_add_subdirectory(cdc_msc)
family_add_subdirectory(cdc_msc_freertos)
family_add_subdirectory(dfu)
family_add_subdirectory(dfu_runtime)
family_add_subdirectory(dynamic_configuration)
family_add_subdirectory(hid_composite)
family_add_subdirectory(hid_composite_freertos)
family_add_subdirectory(hid_generic_inout)
family_add_subdirectory(hid_multiple_interface)
family_add_subdirectory(midi_test)
family_add_subdirectory(msc_dual_lun)
family_add_subdirectory(net_lwip_webserver)
family_add_subdirectory(uac2_headset)
family_add_subdirectory(usbtmc)
family_add_subdirectory(webusb_serial)
65 changes: 28 additions & 37 deletions examples/device/audio_4_channel_mic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
# use BOARD-Directory name for project id
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(PROJECT ${BOARD}-${PROJECT})

# 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)

include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
project(${PROJECT})
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
)

else()
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
endif()
cmake_minimum_required(VERSION 3.5)

include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)

# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})

project(${PROJECT})

# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})

add_executable(${PROJECT})

# 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
)

# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
65 changes: 28 additions & 37 deletions examples/device/audio_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
# use BOARD-Directory name for project id
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(PROJECT ${BOARD}-${PROJECT})

# 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)

include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
project(${PROJECT})
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
)

else()
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
endif()
cmake_minimum_required(VERSION 3.5)

include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)

# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})

project(${PROJECT})

# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})

add_executable(${PROJECT})

# 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
)

# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
49 changes: 24 additions & 25 deletions examples/device/board_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
cmake_minimum_required(VERSION 3.5)

# use BOARD-Directory name for project id
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(PROJECT ${BOARD}-${PROJECT})

# TOP is absolute path to root directory of TinyUSB git repo
set(TOP "../../..")
get_filename_component(TOP "${TOP}" REALPATH)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)

# Check for -DFAMILY=
if(FAMILY MATCHES "^esp32s[2-3]")
cmake_minimum_required(VERSION 3.5)
# use BOARD-Directory name for project id
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(PROJECT ${BOARD}-${PROJECT})

# TOP is absolute path to root directory of TinyUSB git repo
set(TOP "../../..")
get_filename_component(TOP "${TOP}" REALPATH)

include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
project(${PROJECT})

elseif(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)

include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
else()

# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})

project(${PROJECT})
add_executable(${PROJECT})

include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})

add_executable(${PROJECT})

# Example source
target_sources(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
)
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
)

# Example include
target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
${CMAKE_CURRENT_SOURCE_DIR}/src
)

# Example defines
target_compile_definitions(${PROJECT} PUBLIC
CFG_TUSB_OS=OPT_OS_PICO
)

else()
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
endif()
65 changes: 28 additions & 37 deletions examples/device/cdc_dual_ports/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
# use directory name for project id
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(PROJECT ${BOARD}-${PROJECT})

# 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)

include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
project(${PROJECT})
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
)

else()
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
endif()
cmake_minimum_required(VERSION 3.5)

include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)

# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})

project(${PROJECT})

# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})

add_executable(${PROJECT})

# 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
)

# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
3 changes: 2 additions & 1 deletion examples/device/cdc_dual_ports/src/tusb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
67 changes: 29 additions & 38 deletions examples/device/cdc_msc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
# use directory name for project id
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(PROJECT ${BOARD}-${PROJECT})

# 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)

include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
project(${PROJECT})
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.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
)

else()
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
endif()
cmake_minimum_required(VERSION 3.5)

include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)

# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})

project(${PROJECT})

# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})

add_executable(${PROJECT})

# Example source
target_sources(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
)

# Example include
target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)

# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
Loading

0 comments on commit 8ea0dfb

Please sign in to comment.