1
1
cmake_minimum_required (VERSION 3.15 )
2
2
3
3
if (BL_SDK_BASE )
4
- set (CONFIG_CHERRYUSB_DEVICE 1 )
5
4
set (CONFIG_CHERRYUSB_DEVICE_CDC_ACM 1 )
6
5
set (CONFIG_CHERRYUSB_DEVICE_HID 1 )
7
6
set (CONFIG_CHERRYUSB_DEVICE_MSC 1 )
8
7
set (CONFIG_CHERRYUSB_DEVICE_AUDIO 1 )
9
8
set (CONFIG_CHERRYUSB_DEVICE_VIDEO 1 )
10
- set (CONFIG_CHERRYUSB_DEVICE_DCD "bl" )
11
9
12
- set (CONFIG_CHERRYUSB_HOST 1 )
13
10
set (CONFIG_CHERRYUSB_HOST_CDC_ACM 1 )
14
11
set (CONFIG_CHERRYUSB_HOST_CDC_ECM 1 )
15
12
set (CONFIG_CHERRYUSB_HOST_CDC_NCM 1 )
@@ -25,19 +22,23 @@ if(BL_SDK_BASE)
25
22
set (CONFIG_CHERRYUSB_HOST_CP210X 1 )
26
23
set (CONFIG_CHERRYUSB_HOST_FTDI 1 )
27
24
set (CONFIG_CHERRYUSB_HOST_PL2303 1 )
28
- set (CONFIG_CHERRYUSB_OSAL "freertos" )
25
+
26
+ set (CONFIG_CHERRYUSB_DEVICE_DCD "bl" )
29
27
set (CONFIG_CHERRYUSB_HOST_HCD "ehci_bouffalo" )
28
+ set (CONFIG_CHERRYUSB_OSAL "freertos" )
30
29
31
30
include (${CMAKE_CURRENT_LIST_DIR} /cherryusb.cmake )
32
31
33
32
sdk_generate_library (cherryusb )
34
33
sdk_add_include_directories (${cherryusb_incs} )
35
34
sdk_library_add_sources (${cherryusb_srcs} )
36
-
37
- sdk_library_add_sources (platform/lwip/usbh_lwip.c )
38
-
39
35
elseif (HPM_SDK_BASE )
40
- set (CONFIG_CHERRYUSB_HOST 1 )
36
+ set (CONFIG_CHERRYUSB_DEVICE_CDC_ACM 1 )
37
+ set (CONFIG_CHERRYUSB_DEVICE_HID 1 )
38
+ set (CONFIG_CHERRYUSB_DEVICE_MSC 1 )
39
+ set (CONFIG_CHERRYUSB_DEVICE_AUDIO 1 )
40
+ set (CONFIG_CHERRYUSB_DEVICE_VIDEO 1 )
41
+
41
42
set (CONFIG_CHERRYUSB_HOST_CDC_ACM 1 )
42
43
set (CONFIG_CHERRYUSB_HOST_CDC_ECM 1 )
43
44
set (CONFIG_CHERRYUSB_HOST_CDC_NCM 1 )
@@ -54,18 +55,16 @@ elseif(HPM_SDK_BASE)
54
55
set (CONFIG_CHERRYUSB_HOST_FTDI 1 )
55
56
set (CONFIG_CHERRYUSB_HOST_PL2303 1 )
56
57
set (CONFIG_CHERRYUSB_HOST_BL616 1 )
57
- set (CONFIG_CHERRYUSB_OSAL "freertos" )
58
+
59
+ set (CONFIG_CHERRYUSB_DEVICE_DCD "hpm" )
58
60
set (CONFIG_CHERRYUSB_HOST_HCD "ehci_hpm" )
61
+ set (CONFIG_CHERRYUSB_OSAL "freertos" )
59
62
60
63
include (${CMAKE_CURRENT_LIST_DIR} /cherryusb.cmake )
61
64
62
65
sdk_inc (${cherryusb_incs} )
63
66
sdk_src (${cherryusb_srcs} )
64
-
65
- sdk_src (platform/lwip/usbh_lwip.c )
66
-
67
67
elseif (ESP_PLATFORM )
68
-
69
68
set (CONFIG_CHERRYUSB_DEVICE_DCD "dwc2_esp" )
70
69
set (CONFIG_CHERRYUSB_HOST_HCD "dwc2_esp" )
71
70
set (CONFIG_CHERRYUSB_OSAL "idf" )
@@ -81,7 +80,6 @@ elseif(ESP_PLATFORM)
81
80
OR CONFIG_CHERRYUSB_HOST_RTL8152
82
81
OR CONFIG_CHERRYUSB_HOST_BL616
83
82
)
84
- list (APPEND cherryusb_srcs platform/lwip/usbh_lwip.c )
85
83
idf_component_get_property (lwip lwip COMPONENT_LIB )
86
84
target_compile_definitions (${lwip} PRIVATE "-DPBUF_POOL_BUFSIZE=1600" )
87
85
endif ()
@@ -161,4 +159,10 @@ elseif(ESP_PLATFORM)
161
159
if (CONFIG_CHERRYUSB )
162
160
set_source_files_properties ("class/audio/usbd_audio.c" PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized )
163
161
endif ()
162
+ elseif (ZEPHYR_BASE )
163
+ include (${CMAKE_CURRENT_LIST_DIR} /cherryusb.cmake )
164
+
165
+ zephyr_library ()
166
+ zephyr_include_directories (${cherryusb_incs} )
167
+ zephyr_library_sources (${cherryusb_srcs} )
164
168
endif ()
0 commit comments