ITF WCID can be compiled separately.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-04-15 23:44:12 +02:00
parent 10ab0d561c
commit a7be923783
2 changed files with 34 additions and 95 deletions

View File

@@ -51,6 +51,15 @@ elseif (VIDPID STREQUAL "GnuPG")
set(USB_PID 0x2440)
endif()
if(ESP_PLATFORM)
if (DEFINED CONFIG_TINYUSB_DESC_CUSTOM_VID)
set(USB_VID CONFIG_TINYUSB_DESC_CUSTOM_VID)
endif()
if(DEFINED CONFIG_TINYUSB_DESC_CUSTOM_PID)
set(USB_PID CONFIG_TINYUSB_DESC_CUSTOM_PID)
endif()
endif()
if (NOT DEFINED USB_VID)
set(USB_VID 0xFEFF)
endif()
@@ -82,12 +91,16 @@ endif(USB_ITF_HID)
if(USB_ITF_CCID)
add_definitions(-DUSB_ITF_CCID=1)
message(STATUS "USB CCID Interface:\t\t enabled")
if(USB_ITF_WCID)
add_definitions(-DUSB_ITF_WCID=1)
message(STATUS "USB WebCCID Interface:\t enabled")
endif(USB_ITF_WCID)
endif(USB_ITF_CCID)
add_definitions(-DDEBUG_APDU=${DEBUG_APDU})
if (NOT ESP_PLATFORM)
add_definitions(-DMBEDTLS_CONFIG_FILE="${CMAKE_CURRENT_LIST_DIR}/config/mbedtls_config.h")
add_definitions(-DMBEDTLS_CONFIG_FILE="${CMAKE_CURRENT_LIST_DIR}/config/mbedtls_config.h")
else()
add_definitions(-DCFG_TUSB_CONFIG_FILE="${CMAKE_CURRENT_LIST_DIR}/src/usb/tusb_config.h")
add_definitions(-DCFG_TUSB_CONFIG_FILE="${CMAKE_CURRENT_LIST_DIR}/src/usb/tusb_config.h")
endif()
message(STATUS "USB VID/PID: ${USB_VID}:${USB_PID}")