- board_usb_init(controller_index, USB_INIT_DEVICE);
- g_dnl_clear_detach();
- g_dnl_register("usb_dnl_dfu");
- while (1) {
- if (g_dnl_detach()) {
- /*
- * Check if USB bus reset is performed after detach,
- * which indicates that -R switch has been passed to
- * dfu-util. In this case reboot the device
- */
- if (dfu_usb_get_reset()) {
- dfu_reset = true;
- goto exit;
- }