chore(cmake): use config to enable lwip port

This commit is contained in:
sakumisu 2024-08-23 22:36:03 +08:00
parent 2726e2e7b6
commit 8435f1af32
2 changed files with 10 additions and 5 deletions

View File

@ -73,6 +73,11 @@ include(${CMAKE_CURRENT_LIST_DIR}/cherryusb.cmake)
set(ldfragments "osal/idf/linker.lf")
if(CONFIG_CHERRYUSB_HOST_CDC_ECM OR CONFIG_CHERRYUSB_HOST_CDC_RNDIS OR CONFIG_CHERRYUSB_HOST_CDC_NCM
OR CONFIG_CHERRYUSB_HOST_ASIX OR CONFIG_CHERRYUSB_HOST_RTL8152 OR CONFIG_CHERRYUSB_HOST_BL616)
list(APPEND cherryusb_srcs platform/none/usbh_lwip.c)
endif()
idf_component_register(SRCS ${cherryusb_srcs}
INCLUDE_DIRS ${cherryusb_incs}
PRIV_REQUIRES usb

View File

@ -31,11 +31,11 @@
#error PBUF_POOL_BUFSIZE must be larger than 1600
#endif
#define CONFIG_USBHOST_PLATFORM_CDC_ECM
#define CONFIG_USBHOST_PLATFORM_CDC_RNDIS
#define CONFIG_USBHOST_PLATFORM_CDC_NCM
#define CONFIG_USBHOST_PLATFORM_ASIX
#define CONFIG_USBHOST_PLATFORM_RTL8152
// #define CONFIG_USBHOST_PLATFORM_CDC_ECM
// #define CONFIG_USBHOST_PLATFORM_CDC_RNDIS
// #define CONFIG_USBHOST_PLATFORM_CDC_NCM
// #define CONFIG_USBHOST_PLATFORM_ASIX
// #define CONFIG_USBHOST_PLATFORM_RTL8152
// #define CONFIG_USBHOST_PLATFORM_BL616
ip_addr_t g_ipaddr;