File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 4747#define USB_WEBUSB_URL " https://espressif.github.io/arduino-esp32/webusb.html"
4848#endif
4949
50+ #if CFG_TUD_DFU
51+ __attribute__ ((weak, unused)) uint16_t load_dfu_ota_descriptor(uint8_t * dst, uint8_t * itf) {
52+ return 0 ;
53+ }
54+ #endif /* CFG_TUD_DFU */
55+
5056#if CFG_TUD_DFU_RUNTIME
51- static uint16_t load_dfu_descriptor (uint8_t * dst, uint8_t * itf)
57+ __attribute__ ((unused)) static uint16_t load_dfu_descriptor(uint8_t * dst, uint8_t * itf)
5258{
5359#define DFU_ATTRS (DFU_ATTR_CAN_DOWNLOAD | DFU_ATTR_CAN_UPLOAD | DFU_ATTR_MANIFESTATION_TOLERANT)
5460
@@ -185,7 +191,7 @@ bool ESPUSB::begin(){
185191 .webusb_enabled = webusb_enabled,
186192 .webusb_url = webusb_url.c_str ()
187193 };
188- _started = tinyusb_init (&tinyusb_device_config) == ESP_OK;
194+ _started = tinyusb_init (&tinyusb_device_config) == ESP_OK;
189195 }
190196 return _started;
191197}
@@ -203,7 +209,9 @@ ESPUSB::operator bool() const
203209}
204210
205211bool ESPUSB::enableDFU (){
206- #if CFG_TUD_DFU_RUNTIME
212+ #if CFG_TUD_DFU
213+ return tinyusb_enable_interface (USB_INTERFACE_DFU, TUD_DFU_DESC_LEN (1 ), load_dfu_ota_descriptor) == ESP_OK;
214+ #elif CFG_TUD_DFU_RUNTIME
207215 return tinyusb_enable_interface (USB_INTERFACE_DFU, TUD_DFU_RT_DESC_LEN, load_dfu_descriptor) == ESP_OK;
208216#endif /* CFG_TUD_DFU_RUNTIME */
209217 return false ;
You can’t perform that action at this time.
0 commit comments