aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-20 15:09:18 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-20 15:09:18 +0000
commitdb9c410f10474a5998869d447565f9089c69ccff (patch)
tree6a9924df9b59d6ae8e4a1a637e85d1dbf0ee08cd /os/hal/platforms
parent7cac36ba295a6e25db777a3bf6f0e825b49a2acc (diff)
downloadChibiOS-db9c410f10474a5998869d447565f9089c69ccff.tar.gz
ChibiOS-db9c410f10474a5998869d447565f9089c69ccff.tar.bz2
ChibiOS-db9c410f10474a5998869d447565f9089c69ccff.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4592 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms')
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c
index 2653698fd..ef59199c2 100644
--- a/os/hal/platforms/STM32/OTGv1/usb_lld.c
+++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c
@@ -114,6 +114,14 @@ static const stm32_otg_params_t hsparams = {
/* Driver local functions. */
/*===========================================================================*/
+static void usb_lld_wakeup_pump(USBDriver *usbp) {
+
+ if (usbp->thd_wait != NULL) {
+ chThdResumeI(usbp->thd_wait);
+ usbp->thd_wait = NULL;
+ }
+}
+
static void otg_core_reset(stm32_otg_t *otgp) {
/* Core reset and delay of at least 3 PHY cycles.*/
@@ -546,10 +554,7 @@ static void otg_epin_handler(USBDriver *usbp, usbep_t ep) {
chSysLockFromIsr();
usbp->txpending |= (1 << ep);
otgp->DIEPEMPMSK &= ~(1 << ep);
- if (usbp->thd_wait != NULL) {
- chThdResumeI(usbp->thd_wait);
- usbp->thd_wait = NULL;
- }
+ usb_lld_wakeup_pump(usbp);
chSysUnlockFromIsr();
}
}
@@ -615,14 +620,9 @@ static void usb_lld_serve_interrupt(USBDriver *usbp) {
if (sts & GINTSTS_RXFLVL) {
/* The interrupt is masked while the thread has control or it would
be triggered again.*/
- otgp->GINTMSK &= ~GINTMSK_RXFLVLM;
- /* Checks if the thread is waiting for an event.*/
chSysLockFromIsr();
- if (usbp->thd_wait != NULL) {
- /* The thread is made ready, it will be scheduled on ISR exit.*/
- chThdResumeI(usbp->thd_wait);
- usbp->thd_wait = NULL;
- }
+ otgp->GINTMSK &= ~GINTMSK_RXFLVLM;
+ usb_lld_wakeup_pump(usbp);
chSysUnlockFromIsr();
}