Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thirdpin/libopencm3.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/usb
diff options
context:
space:
mode:
authorFrantisek Burian <BuFran@seznam.cz>2014-12-19 02:34:01 +0300
committerKarl Palsson <karlp@tweak.net.au>2015-07-15 03:18:57 +0300
commit13004f81ee77b2a8e30cb8702c6b4fa8a349e4cb (patch)
treebfd3c3909fa306bcba7adea3165c5b4851b12b03 /lib/usb
parenta4bb8f7e240c9f238384cf86d009002ba42a25ed (diff)
usb_f103: Clear ISR bit as soon as possible, as for the other IRQs.
Reported by Uwe in https://github.com/libopencm3/libopencm3/pull/274 but expanded and provided by BuFran finally.
Diffstat (limited to 'lib/usb')
-rw-r--r--lib/usb/usb_f103.c4
1 files changed, 2 insertions, 2 deletions
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();
}
}