CMakeLists.txt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. idf_component_register(REQUIRES esp_rom freertos soc driver)
  2. if(CONFIG_USB_ENABLED)
  3. idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
  4. target_compile_options(${COMPONENT_TARGET} INTERFACE
  5. "-DCFG_TUSB_MCU=OPT_MCU_ESP32_S2"
  6. )
  7. target_include_directories(${COMPONENT_TARGET} INTERFACE
  8. "${FREERTOS_ORIG_INCLUDE_PATH}"
  9. # espressif:
  10. "${COMPONENT_DIR}/port/esp32s2/include/"
  11. "${COMPONENT_DIR}/port/common/include"
  12. # tusb:
  13. "${COMPONENT_DIR}/tinyusb/hw/bsp/"
  14. "${COMPONENT_DIR}/tinyusb/src/"
  15. "${COMPONENT_DIR}/tinyusb/src/device"
  16. )
  17. target_sources(${COMPONENT_TARGET} INTERFACE
  18. # espressif:
  19. "${COMPONENT_DIR}/port/common/src/descriptors_control.c"
  20. "${COMPONENT_DIR}/port/common/src/usb_descriptors.c"
  21. "${COMPONENT_DIR}/port/common/src/usbd.c"
  22. "${COMPONENT_DIR}/port/esp32s2/src/device_controller_driver.c"
  23. "${COMPONENT_DIR}/port/esp32s2/src/tinyusb.c"
  24. # tusb:
  25. "${COMPONENT_DIR}/tinyusb/src/common/tusb_fifo.c"
  26. "${COMPONENT_DIR}/tinyusb/src/device/usbd_control.c"
  27. "${COMPONENT_DIR}/tinyusb/src/class/msc/msc_device.c"
  28. "${COMPONENT_DIR}/tinyusb/src/class/cdc/cdc_device.c"
  29. "${COMPONENT_DIR}/tinyusb/src/class/hid/hid_device.c"
  30. "${COMPONENT_DIR}/tinyusb/src/class/midi/midi_device.c"
  31. "${COMPONENT_DIR}/tinyusb/src/tusb.c"
  32. )
  33. endif()