From 8435f1af324e912be3986b80c73e614da34a7c20 Mon Sep 17 00:00:00 2001 From: sakumisu <1203593632@qq.com> Date: Fri, 23 Aug 2024 22:36:03 +0800 Subject: [PATCH] chore(cmake): use config to enable lwip port --- CMakeLists.txt | 5 +++++ platform/none/usbh_lwip.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1471bda7..c7cb2d05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/platform/none/usbh_lwip.c b/platform/none/usbh_lwip.c index 9dd18822..16d4f306 100644 --- a/platform/none/usbh_lwip.c +++ b/platform/none/usbh_lwip.c @@ -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;