diff --git a/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/CMakeLists.txt b/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/CMakeLists.txt index 8add189358..c3c65dae94 100644 --- a/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/CMakeLists.txt @@ -4,5 +4,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(tusb_composite) diff --git a/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/main/CMakeLists.txt b/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/main/CMakeLists.txt index bed76116a7..b8dc619bb8 100644 --- a/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/main/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/main/CMakeLists.txt @@ -1,8 +1,5 @@ -set(srcs "tusb_composite_main.c") -set(requires fatfs wear_levelling) - idf_component_register( - SRCS "${srcs}" + SRCS tusb_composite_main.c INCLUDE_DIRS . - REQUIRES "${requires}" + PRIV_REQUIRES fatfs wear_levelling esp_partition ) diff --git a/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/main/tusb_composite_main.c b/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/main/tusb_composite_main.c index 432b1b69d2..332b508f0f 100644 --- a/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/main/tusb_composite_main.c +++ b/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/main/tusb_composite_main.c @@ -7,6 +7,7 @@ #include #include #include +#include "esp_partition.h" #include "esp_check.h" #include "tinyusb.h" #include "tusb_msc_storage.h" diff --git a/examples/peripherals/usb/device/tusb_console/CMakeLists.txt b/examples/peripherals/usb/device/tusb_console/CMakeLists.txt index cc9728ef50..37eb8efa98 100644 --- a/examples/peripherals/usb/device/tusb_console/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_console/CMakeLists.txt @@ -2,5 +2,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(tusb_console) diff --git a/examples/peripherals/usb/device/tusb_console/main/tusb_console_main.c b/examples/peripherals/usb/device/tusb_console/main/tusb_console_main.c index efb91ba6f0..35db3b8ad4 100644 --- a/examples/peripherals/usb/device/tusb_console/main/tusb_console_main.c +++ b/examples/peripherals/usb/device/tusb_console/main/tusb_console_main.c @@ -13,7 +13,6 @@ #include #include #include "esp_log.h" -#include "esp_vfs.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "tinyusb.h" diff --git a/examples/peripherals/usb/device/tusb_hid/CMakeLists.txt b/examples/peripherals/usb/device/tusb_hid/CMakeLists.txt index 10fca49ed8..7ca5ffba94 100644 --- a/examples/peripherals/usb/device/tusb_hid/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_hid/CMakeLists.txt @@ -4,5 +4,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(tusb_hid) diff --git a/examples/peripherals/usb/device/tusb_hid/main/CMakeLists.txt b/examples/peripherals/usb/device/tusb_hid/main/CMakeLists.txt index a59bffcb5f..25a3164ece 100644 --- a/examples/peripherals/usb/device/tusb_hid/main/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_hid/main/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register( SRCS "tusb_hid_example_main.c" INCLUDE_DIRS "." - REQUIRES driver + PRIV_REQUIRES driver ) diff --git a/examples/peripherals/usb/device/tusb_midi/CMakeLists.txt b/examples/peripherals/usb/device/tusb_midi/CMakeLists.txt index ac9504929b..0cf190b786 100644 --- a/examples/peripherals/usb/device/tusb_midi/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_midi/CMakeLists.txt @@ -2,5 +2,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(tusb_midi) diff --git a/examples/peripherals/usb/device/tusb_midi/main/CMakeLists.txt b/examples/peripherals/usb/device/tusb_midi/main/CMakeLists.txt index a22f21af54..01775bf6f8 100644 --- a/examples/peripherals/usb/device/tusb_midi/main/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_midi/main/CMakeLists.txt @@ -1,3 +1,4 @@ idf_component_register(SRCS "tusb_midi_main.c" INCLUDE_DIRS "." + PRIV_REQUIRES esp_timer ) diff --git a/examples/peripherals/usb/device/tusb_msc/CMakeLists.txt b/examples/peripherals/usb/device/tusb_msc/CMakeLists.txt index a0abd7ebbd..f5696c5231 100644 --- a/examples/peripherals/usb/device/tusb_msc/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_msc/CMakeLists.txt @@ -4,5 +4,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(tusb_msc) diff --git a/examples/peripherals/usb/device/tusb_msc/main/CMakeLists.txt b/examples/peripherals/usb/device/tusb_msc/main/CMakeLists.txt index de4c14c1ea..7c7438e1a6 100644 --- a/examples/peripherals/usb/device/tusb_msc/main/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_msc/main/CMakeLists.txt @@ -1,12 +1,11 @@ -set(srcs "tusb_msc_main.c") -set(requires fatfs console) +set(priv_requires fatfs console) if(CONFIG_EXAMPLE_STORAGE_MEDIA_SPIFLASH) - list(APPEND requires wear_levelling) + list(APPEND priv_requires wear_levelling esp_partition) endif() idf_component_register( - SRCS "${srcs}" + SRCS "tusb_msc_main.c" INCLUDE_DIRS . - REQUIRES "${requires}" + PRIV_REQUIRES "${priv_requires}" ) diff --git a/examples/peripherals/usb/device/tusb_msc/main/tusb_msc_main.c b/examples/peripherals/usb/device/tusb_msc/main/tusb_msc_main.c index 9d44945ce8..7c157bf037 100644 --- a/examples/peripherals/usb/device/tusb_msc/main/tusb_msc_main.c +++ b/examples/peripherals/usb/device/tusb_msc/main/tusb_msc_main.c @@ -15,6 +15,7 @@ #include #include "esp_console.h" #include "esp_check.h" +#include "esp_partition.h" #include "driver/gpio.h" #include "tinyusb.h" #include "tusb_msc_storage.h" diff --git a/examples/peripherals/usb/device/tusb_ncm/CMakeLists.txt b/examples/peripherals/usb/device/tusb_ncm/CMakeLists.txt index dddc2f4f99..4b7716256d 100644 --- a/examples/peripherals/usb/device/tusb_ncm/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_ncm/CMakeLists.txt @@ -2,5 +2,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(tusb_ncm) diff --git a/examples/peripherals/usb/device/tusb_ncm/main/CMakeLists.txt b/examples/peripherals/usb/device/tusb_ncm/main/CMakeLists.txt index 270ce7f388..cb3fe66423 100644 --- a/examples/peripherals/usb/device/tusb_ncm/main/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_ncm/main/CMakeLists.txt @@ -1,2 +1,4 @@ idf_component_register(SRCS "tusb_ncm_main.c" - INCLUDE_DIRS "") + INCLUDE_DIRS "" + PRIV_REQUIRES esp_wifi nvs_flash + ) diff --git a/examples/peripherals/usb/device/tusb_serial_device/CMakeLists.txt b/examples/peripherals/usb/device/tusb_serial_device/CMakeLists.txt index a4c54f1ac2..f46c3b7541 100644 --- a/examples/peripherals/usb/device/tusb_serial_device/CMakeLists.txt +++ b/examples/peripherals/usb/device/tusb_serial_device/CMakeLists.txt @@ -2,5 +2,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(tusb_serial_device) diff --git a/examples/peripherals/usb/host/cdc/cdc_acm_host/CMakeLists.txt b/examples/peripherals/usb/host/cdc/cdc_acm_host/CMakeLists.txt index 067259a1fb..8c87d66a05 100644 --- a/examples/peripherals/usb/host/cdc/cdc_acm_host/CMakeLists.txt +++ b/examples/peripherals/usb/host/cdc/cdc_acm_host/CMakeLists.txt @@ -4,5 +4,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(cdc_acm_host) diff --git a/examples/peripherals/usb/host/cdc/cdc_acm_host/main/CMakeLists.txt b/examples/peripherals/usb/host/cdc/cdc_acm_host/main/CMakeLists.txt index 72a9796821..3b0d7035d4 100644 --- a/examples/peripherals/usb/host/cdc/cdc_acm_host/main/CMakeLists.txt +++ b/examples/peripherals/usb/host/cdc/cdc_acm_host/main/CMakeLists.txt @@ -1,2 +1,4 @@ idf_component_register(SRCS "usb_cdc_example_main.c" - INCLUDE_DIRS ".") + INCLUDE_DIRS "." + PRIV_REQUIRES usb + ) diff --git a/examples/peripherals/usb/host/cdc/cdc_acm_vcp/CMakeLists.txt b/examples/peripherals/usb/host/cdc/cdc_acm_vcp/CMakeLists.txt index daa5b7c53c..25ae86a6d1 100644 --- a/examples/peripherals/usb/host/cdc/cdc_acm_vcp/CMakeLists.txt +++ b/examples/peripherals/usb/host/cdc/cdc_acm_vcp/CMakeLists.txt @@ -4,5 +4,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(cdc_acm_vcp) diff --git a/examples/peripherals/usb/host/cdc/cdc_acm_vcp/main/CMakeLists.txt b/examples/peripherals/usb/host/cdc/cdc_acm_vcp/main/CMakeLists.txt index 7fefe3ecbd..e52dfe2ba8 100644 --- a/examples/peripherals/usb/host/cdc/cdc_acm_vcp/main/CMakeLists.txt +++ b/examples/peripherals/usb/host/cdc/cdc_acm_vcp/main/CMakeLists.txt @@ -1,4 +1,5 @@ idf_component_register( SRCS "cdc_acm_vcp_example_main.cpp" INCLUDE_DIRS "." + PRIV_REQUIRES usb ) diff --git a/examples/peripherals/usb/host/hid/CMakeLists.txt b/examples/peripherals/usb/host/hid/CMakeLists.txt index 6b4e5b0df4..8539d7fc08 100644 --- a/examples/peripherals/usb/host/hid/CMakeLists.txt +++ b/examples/peripherals/usb/host/hid/CMakeLists.txt @@ -2,6 +2,8 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME) string(REPLACE " " "_" ProjectId ${ProjectId}) diff --git a/examples/peripherals/usb/host/hid/main/CMakeLists.txt b/examples/peripherals/usb/host/hid/main/CMakeLists.txt index 20aa32069e..724c538d4b 100644 --- a/examples/peripherals/usb/host/hid/main/CMakeLists.txt +++ b/examples/peripherals/usb/host/hid/main/CMakeLists.txt @@ -1,2 +1,4 @@ idf_component_register(SRCS "hid_host_example.c" - INCLUDE_DIRS ".") + INCLUDE_DIRS "." + PRIV_REQUIRES usb driver + ) diff --git a/examples/peripherals/usb/host/msc/CMakeLists.txt b/examples/peripherals/usb/host/msc/CMakeLists.txt index db2bb4b8bc..6539095888 100644 --- a/examples/peripherals/usb/host/msc/CMakeLists.txt +++ b/examples/peripherals/usb/host/msc/CMakeLists.txt @@ -2,5 +2,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(usb-msc) diff --git a/examples/peripherals/usb/host/msc/main/CMakeLists.txt b/examples/peripherals/usb/host/msc/main/CMakeLists.txt index e4e3bca4b3..344024ba7d 100644 --- a/examples/peripherals/usb/host/msc/main/CMakeLists.txt +++ b/examples/peripherals/usb/host/msc/main/CMakeLists.txt @@ -1,3 +1,4 @@ idf_component_register(SRCS "msc_example_main.c" INCLUDE_DIRS "" - REQUIRES usb vfs) + PRIV_REQUIRES usb fatfs driver esp_timer + ) diff --git a/examples/peripherals/usb/host/msc/main/msc_example_main.c b/examples/peripherals/usb/host/msc/main/msc_example_main.c index 53c28bc26e..1fbe55afc8 100644 --- a/examples/peripherals/usb/host/msc/main/msc_example_main.c +++ b/examples/peripherals/usb/host/msc/main/msc_example_main.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/event_groups.h" @@ -16,11 +17,9 @@ #include "msc_host.h" #include "msc_host_vfs.h" #include "ffconf.h" -#include "esp_vfs.h" #include "errno.h" -#include "hal/usb_hal.h" #include "driver/gpio.h" -#include +#include "esp_vfs_fat.h" #define USB_DISCONNECT_PIN GPIO_NUM_10 diff --git a/examples/peripherals/usb/host/usb_host_lib/CMakeLists.txt b/examples/peripherals/usb/host/usb_host_lib/CMakeLists.txt index 5e5010f3f9..7ec0dec360 100644 --- a/examples/peripherals/usb/host/usb_host_lib/CMakeLists.txt +++ b/examples/peripherals/usb/host/usb_host_lib/CMakeLists.txt @@ -2,5 +2,7 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(usb_host_lib_example) diff --git a/examples/peripherals/usb/host/usb_host_lib/main/CMakeLists.txt b/examples/peripherals/usb/host/usb_host_lib/main/CMakeLists.txt index 62648acbe0..260f313fea 100644 --- a/examples/peripherals/usb/host/usb_host_lib/main/CMakeLists.txt +++ b/examples/peripherals/usb/host/usb_host_lib/main/CMakeLists.txt @@ -1,2 +1,4 @@ idf_component_register(SRCS "usb_host_lib_main.c" "class_driver.c" - INCLUDE_DIRS ".") + INCLUDE_DIRS "." + PRIV_REQUIRES usb + ) diff --git a/examples/peripherals/usb/host/uvc/CMakeLists.txt b/examples/peripherals/usb/host/uvc/CMakeLists.txt index 9cab8a3bcb..71318b7ecb 100644 --- a/examples/peripherals/usb/host/uvc/CMakeLists.txt +++ b/examples/peripherals/usb/host/uvc/CMakeLists.txt @@ -2,5 +2,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(usb-uvc) diff --git a/examples/peripherals/usb/host/uvc/main/CMakeLists.txt b/examples/peripherals/usb/host/uvc/main/CMakeLists.txt index 1ab9ce5ce5..ba600886a1 100644 --- a/examples/peripherals/usb/host/uvc/main/CMakeLists.txt +++ b/examples/peripherals/usb/host/uvc/main/CMakeLists.txt @@ -1,3 +1,3 @@ idf_component_register(SRCS "main.c" "tcp_server.c" INCLUDE_DIRS "" - REQUIRES protocol_examples_common nvs_flash usb mdns esp_ringbuf esp_timer esp_wifi driver) + PRIV_REQUIRES protocol_examples_common nvs_flash usb mdns esp_ringbuf esp_timer esp_wifi driver)