summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2024-08-23 22:36:03 +0800
committersakumisu <[email protected]>2024-08-23 22:36:03 +0800
commit8435f1af324e912be3986b80c73e614da34a7c20 (patch)
treef724aa47a291c988a3ae4538256f2000c3b2f53f
parent2726e2e7b697f2e072f918623578903bd9eddf37 (diff)
chore(cmake): use config to enable lwip port
-rw-r--r--CMakeLists.txt5
-rw-r--r--platform/none/usbh_lwip.c10
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;