File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,6 +94,14 @@ static void dfu_on_download_complete(usbd_device* usbd_dev, struct usb_setup_dat
9494 dfu_set_state (STATE_DFU_MANIFEST_SYNC );
9595}
9696
97+ static void dfu_on_detach_complete (usbd_device * usbd_dev , struct usb_setup_data * req ) {
98+ (void )usbd_dev ;
99+ (void )req ;
100+
101+ /* Reset and maybe launch the application */
102+ scb_reset_system ();
103+ }
104+
97105static void dfu_on_download_request (usbd_device * usbd_dev , struct usb_setup_data * req ) {
98106 (void )usbd_dev ;
99107 (void )req ;
@@ -293,11 +301,12 @@ dfu_control_class_request(usbd_device *usbd_dev,
293301 break ;
294302 }
295303#endif
296- case DFU_DETACH :
297- /* Best we can do! */
298- scb_reset_system () ;
304+
305+ case DFU_DETACH : {
306+ * complete = & dfu_on_detach_complete ;
299307 status = USBD_REQ_HANDLED ;
300308 break ;
309+ }
301310
302311 default : {
303312 /* Stall the control pipe */
You can’t perform that action at this time.
0 commit comments