File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 47
47
#define USB_WEBUSB_URL " https://espressif.github.io/arduino-esp32/webusb.html"
48
48
#endif
49
49
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
+
50
56
#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)
52
58
{
53
59
#define DFU_ATTRS (DFU_ATTR_CAN_DOWNLOAD | DFU_ATTR_CAN_UPLOAD | DFU_ATTR_MANIFESTATION_TOLERANT)
54
60
@@ -185,7 +191,7 @@ bool ESPUSB::begin(){
185
191
.webusb_enabled = webusb_enabled,
186
192
.webusb_url = webusb_url.c_str ()
187
193
};
188
- _started = tinyusb_init (&tinyusb_device_config) == ESP_OK;
194
+ _started = tinyusb_init (&tinyusb_device_config) == ESP_OK;
189
195
}
190
196
return _started;
191
197
}
@@ -203,7 +209,9 @@ ESPUSB::operator bool() const
203
209
}
204
210
205
211
bool 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
207
215
return tinyusb_enable_interface (USB_INTERFACE_DFU, TUD_DFU_RT_DESC_LEN, load_dfu_descriptor) == ESP_OK;
208
216
#endif /* CFG_TUD_DFU_RUNTIME */
209
217
return false ;
You can’t perform that action at this time.
0 commit comments