DFU: minor, remove unused/duplicate code

This commit is contained in:
King Kévin 2020-11-27 16:05:37 +01:00
parent 0bb2be3727
commit 8918b97618
1 changed files with 0 additions and 2 deletions

View File

@ -363,12 +363,10 @@ void usb_dfu_setup(void)
rcc_periph_reset_pulse(RST_OTGFS); // reset USB peripheral
usb_disconnect(); // disconnect to force re-enumeration
rcc_periph_clock_enable(RCC_GPIOA); // enable clock for GPIO used for USB
rcc_periph_clock_enable(RCC_OTGFS); // enable clock for USB domain
gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO11 | GPIO12); // set pin to alternate function
gpio_set_af(GPIOA, GPIO_AF10, GPIO11 | GPIO12); // set alternate function to USB
usb_device = usbd_init(&otgfs_usb_driver, &usb_dfu_device, &usb_dfu_configuration, usb_dfu_strings, LENGTH(usb_dfu_strings), usbd_control_buffer, sizeof(usbd_control_buffer)); // configure USB device
usbd_register_control_callback(usb_device, USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE, USB_REQ_TYPE_TYPE | USB_REQ_TYPE_RECIPIENT, usb_dfu_control_request); // set control request handling DFU operations
//usbd_register_set_config_callback(usb_device, usb_dfu_set_config); // configure the callback to setup the USB configuration endpoint
}
void usb_dfu_start(void)