diff --git a/lib/usb/usb_f103.c b/lib/usb/usb_f103.c index 2985650b..26c27941 100644 --- a/lib/usb/usb_f103.c +++ b/lib/usb/usb_f103.c @@ -300,9 +300,9 @@ static void stm32f103_poll(usbd_device *dev) uint16_t istr = *USB_ISTR_REG; if (istr & USB_ISTR_RESET) { + USB_CLR_ISTR_RESET(); dev->pm_top = 0x40; _usbd_reset(dev); - USB_CLR_ISTR_RESET(); return; } @@ -338,9 +338,9 @@ static void stm32f103_poll(usbd_device *dev) } if (istr & USB_ISTR_SOF) { + USB_CLR_ISTR_SOF(); if (dev->user_callback_sof) { dev->user_callback_sof(); } - USB_CLR_ISTR_SOF(); } }