-
Notifications
You must be signed in to change notification settings - Fork 808
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'change/usb_device_local_tinyusb_component_usage' into '…
…master' change(usb_device): Added possibility to use local tinyusb component during the build See merge request ae_group/esp-iot-solution!1124
- Loading branch information
Showing
8 changed files
with
42 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
idf_component_register( | ||
SRCS "../hid_device/usb_descriptors.c" "tinyusb_hid.c" "usb_hid_device_main.c" | ||
INCLUDE_DIRS "../hid_device" | ||
SRCS "tinyusb_hid.c" "usb_hid_device_main.c" | ||
INCLUDE_DIRS "." | ||
PRIV_INCLUDE_DIRS "../hid_device" | ||
) | ||
|
||
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0") | ||
idf_component_get_property(tusb_lib espressif__tinyusb COMPONENT_LIB) | ||
# Determine whether tinyusb is fetched from component registry or from local path | ||
idf_build_get_property(build_components BUILD_COMPONENTS) | ||
if(tinyusb IN_LIST build_components) | ||
set(tinyusb_name tinyusb) # Local component | ||
else() | ||
idf_component_get_property(tusb_lib leeebo__tinyusb_src COMPONENT_LIB) | ||
set(tinyusb_name espressif__tinyusb) # Managed component | ||
endif() | ||
|
||
# Pass tusb_config.h to the example | ||
idf_component_get_property(tusb_lib ${tinyusb_name} COMPONENT_LIB) | ||
target_include_directories(${tusb_lib} PUBLIC "../hid_device") | ||
target_sources(${tusb_lib} PUBLIC "../hid_device/usb_descriptors.c") | ||
|
||
cmake_policy(SET CMP0079 NEW) | ||
target_link_libraries(${tusb_lib} PRIVATE ${COMPONENT_LIB}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
idf_component_register( | ||
SRCS "main.c" "usb_descriptors.c" | ||
SRCS "main.c" | ||
INCLUDE_DIRS "." | ||
PRIV_INCLUDE_DIRS "." | ||
) | ||
|
||
idf_component_get_property(tusb_lib leeebo__tinyusb_src COMPONENT_LIB) | ||
# Determine whether tinyusb is fetched from component registry or from local path | ||
idf_build_get_property(build_components BUILD_COMPONENTS) | ||
if(tinyusb IN_LIST build_components) | ||
set(tinyusb_name tinyusb) # Local component | ||
else() | ||
set(tinyusb_name espressif__tinyusb) # Managed component | ||
endif() | ||
|
||
# Pass tusb_config.h to the example | ||
idf_component_get_property(tusb_lib ${tinyusb_name} COMPONENT_LIB) | ||
target_include_directories(${tusb_lib} PUBLIC ".") | ||
target_sources(${tusb_lib} PUBLIC "./usb_descriptors.c") | ||
|
||
cmake_policy(SET CMP0079 NEW) | ||
target_link_libraries(${tusb_lib} PRIVATE ${COMPONENT_LIB}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters