@@ -32,8 +32,12 @@ set(CORE_SRCS
32
32
cores/esp32/stdlib_noniso.c
33
33
cores/esp32/Stream.cpp
34
34
cores/esp32/StreamString.cpp
35
+ cores/esp32/HWCDC.cpp
35
36
cores/esp32/USB.cpp
36
37
cores/esp32/USBCDC.cpp
38
+ cores/esp32/USBMSC.cpp
39
+ cores/esp32/FirmwareMSC.cpp
40
+ cores/esp32/firmware_msc_fat.c
37
41
cores/esp32/wiring_pulse.c
38
42
cores/esp32/wiring_shift.c
39
43
cores/esp32/WMath.cpp
@@ -55,7 +59,7 @@ set(LIBRARY_SRCS
55
59
libraries/FS/src/vfs_api.cpp
56
60
libraries/HTTPClient/src/HTTPClient.cpp
57
61
libraries/HTTPUpdate/src/HTTPUpdate.cpp
58
- libraries/LITTLEFS /src/LITTLEFS .cpp
62
+ libraries/LittleFS /src/LittleFS .cpp
59
63
libraries/NetBIOS/src/NetBIOS.cpp
60
64
libraries/Preferences/src/Preferences.cpp
61
65
libraries/RainMaker/src/RMaker.cpp
@@ -73,6 +77,14 @@ set(LIBRARY_SRCS
73
77
libraries/Ticker/src/Ticker.cpp
74
78
libraries/Update/src/Updater.cpp
75
79
libraries/Update/src/HttpsOTAUpdate.cpp
80
+ libraries/USB/src/USBHID.cpp
81
+ libraries/USB/src/USBHIDMouse.cpp
82
+ libraries/USB/src/USBHIDKeyboard.cpp
83
+ libraries/USB/src/USBHIDGamepad.cpp
84
+ libraries/USB/src/USBHIDConsumerControl.cpp
85
+ libraries/USB/src/USBHIDSystemControl.cpp
86
+ libraries/USB/src/USBHIDVendor.cpp
87
+ libraries/USB/src/USBVendor.cpp
76
88
libraries/WebServer/src/WebServer.cpp
77
89
libraries/WebServer/src/Parsing.cpp
78
90
libraries/WebServer/src/detail/mimetable.cpp
@@ -140,7 +152,7 @@ set(includedirs
140
152
libraries/FS/src
141
153
libraries/HTTPClient/src
142
154
libraries/HTTPUpdate/src
143
- libraries/LITTLEFS /src
155
+ libraries/LittleFS /src
144
156
libraries/NetBIOS/src
145
157
libraries/Preferences/src
146
158
libraries/RainMaker/src
@@ -151,6 +163,7 @@ set(includedirs
151
163
libraries/SPI/src
152
164
libraries/Ticker/src
153
165
libraries/Update/src
166
+ libraries/USB/src
154
167
libraries/WebServer/src
155
168
libraries/WiFiClientSecure/src
156
169
libraries/WiFi/src
@@ -161,25 +174,50 @@ set(includedirs
161
174
set (srcs ${CORE_SRCS} ${LIBRARY_SRCS} ${BLE_SRCS} )
162
175
set (priv_includes cores/esp32/libb64)
163
176
set (requires spi_flash mbedtls mdns esp_adc_cal wifi_provisioning nghttp)
164
- set (priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt main )
177
+ set (priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt esp_ipc esp_hid )
165
178
179
+ idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires} )
180
+
181
+ string (TOUPPER ${CONFIG_IDF_TARGET} idf_target_caps)
182
+ target_compile_options (${COMPONENT_TARGET} PUBLIC
183
+ -DARDUINO=10812
184
+ -DARDUINO_${idf_target_caps} _DEV
185
+ -DARDUINO_ARCH_ESP32
186
+ -DARDUINO_BOARD="${idf_target_caps} _DEV"
187
+ -DARDUINO_VARIANT="${CONFIG_IDF_TARGET} "
188
+ -DESP32)
189
+
190
+ if (CONFIG_AUTOSTART_ARDUINO)
191
+ # in autostart mode, arduino-esp32 contains app_main() function and needs to
192
+ # reference setup() and loop() in the main component. If we add main
193
+ # component to priv_requires then we create a large circular dependency
194
+ # (arduino-esp32 -> main -> arduino-esp32) and can get linker errors, so
195
+ # instead we add setup() and loop() to the undefined symbols list so the
196
+ # linker will always include them.
197
+ #
198
+ # (As they are C++ symbol, we need to add the C++ mangled names.)
199
+ target_link_libraries (${COMPONENT_LIB} INTERFACE "-u _Z5setupv -u _Z4loopv" )
200
+ endif ()
201
+
202
+ # This function adds a dependency on the given component if the component is included into the build.
203
+ function (maybe_add_component component_name)
204
+ idf_build_get_property(components BUILD_COMPONENTS)
205
+ if (${component_name} IN_LIST components)
206
+ idf_component_get_property(lib_name ${component_name} COMPONENT_LIB)
207
+ target_link_libraries (${COMPONENT_LIB} PUBLIC ${lib_name} )
208
+ endif ()
209
+ endfunction ()
210
+
211
+ if (IDF_TARGET MATCHES "esp32" AND CONFIG_ESP_RMAKER_TASK_STACK)
212
+ maybe_add_component(esp_rainmaker)
213
+ maybe_add_component(qrcode)
214
+ endif ()
166
215
if (IDF_TARGET MATCHES "esp32s2|esp32s3" AND CONFIG_TINYUSB_ENABLED)
167
- list ( APPEND priv_requires arduino_tinyusb)
216
+ maybe_add_component( arduino_tinyusb)
168
217
endif ()
169
218
if (NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_ArduinoOTA)
170
- list ( APPEND priv_requires esp_https_ota)
219
+ maybe_add_component( esp_https_ota)
171
220
endif ()
172
221
if (NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_LITTLEFS)
173
- if (CONFIG_LITTLEFS_PAGE_SIZE)
174
- list (APPEND priv_requires esp_littlefs)
175
- endif ()
176
- endif ()
177
-
178
- idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires} )
179
-
180
- if (IDF_TARGET STREQUAL "esp32" )
181
- target_compile_options (${COMPONENT_TARGET} PUBLIC -DARDUINO=10812 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="ESP32_DEV" -DARDUINO_VARIANT="esp32" -DESP32)
182
- endif ()
183
- if (IDF_TARGET STREQUAL "esp32s2" )
184
- target_compile_options (${COMPONENT_TARGET} PUBLIC -DARDUINO=10812 -DARDUINO_ESP32S2_DEV -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="ESP32S2_DEV" -DARDUINO_VARIANT="esp32s2" -DESP32)
222
+ maybe_add_component(esp_littlefs)
185
223
endif ()
0 commit comments