diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2015-01-11 10:21:26 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2015-01-11 10:21:26 +0000 |
commit | e7f1c3bf7275f553529cb17e6e5a9815aea8e6b0 (patch) | |
tree | b0765bf7ac8c8bc00ad46baa9619dc46a93da085 | |
parent | c7c04a2dfd295cc7cc2ad3f3bddeea378bb5009a (diff) | |
download | ChibiOS-e7f1c3bf7275f553529cb17e6e5a9815aea8e6b0.tar.gz ChibiOS-e7f1c3bf7275f553529cb17e6e5a9815aea8e6b0.tar.bz2 ChibiOS-e7f1c3bf7275f553529cb17e6e5a9815aea8e6b0.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7619 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/ports/STM32/LLD/USBv1/usb_lld.c | 4 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/USBv1/usb_lld.h | 4 | ||||
-rw-r--r-- | testhal/STM32/STM32F0xx/USB_CDC/mcuconf.h | 1 | ||||
-rw-r--r-- | testhal/STM32/STM32F0xx/USB_CDC/readme.txt | 6 |
4 files changed, 10 insertions, 5 deletions
diff --git a/os/hal/ports/STM32/LLD/USBv1/usb_lld.c b/os/hal/ports/STM32/LLD/USBv1/usb_lld.c index ac8c2189f..b8e2ed114 100644 --- a/os/hal/ports/STM32/LLD/USBv1/usb_lld.c +++ b/os/hal/ports/STM32/LLD/USBv1/usb_lld.c @@ -448,7 +448,9 @@ void usb_lld_start(USBDriver *usbp) { STM32_USB->CNTR = CNTR_FRES;
/* Enabling the USB IRQ vectors, this also gives enough time to allow
the transceiver power up (1uS).*/
+#if STM32_USB1_HP_NUMBER != STM32_USB1_LP_NUMBER
nvicEnableVector(STM32_USB1_HP_NUMBER, STM32_USB_USB1_HP_IRQ_PRIORITY);
+#endif
nvicEnableVector(STM32_USB1_LP_NUMBER, STM32_USB_USB1_LP_IRQ_PRIORITY);
/* Releases the USB reset.*/
STM32_USB->CNTR = 0;
@@ -473,7 +475,9 @@ void usb_lld_stop(USBDriver *usbp) { if (usbp->state == USB_STOP) {
#if STM32_USB_USE_USB1
if (&USBD1 == usbp) {
+#if STM32_USB1_HP_NUMBER != STM32_USB1_LP_NUMBER
nvicDisableVector(STM32_USB1_HP_NUMBER);
+#endif
nvicDisableVector(STM32_USB1_LP_NUMBER);
STM32_USB->CNTR = CNTR_PDWN | CNTR_FRES;
rccDisableUSB(FALSE);
diff --git a/os/hal/ports/STM32/LLD/USBv1/usb_lld.h b/os/hal/ports/STM32/LLD/USBv1/usb_lld.h index b32597921..2067ad518 100644 --- a/os/hal/ports/STM32/LLD/USBv1/usb_lld.h +++ b/os/hal/ports/STM32/LLD/USBv1/usb_lld.h @@ -71,7 +71,8 @@ /**
* @brief USB1 interrupt priority level setting.
*/
-#if !defined(STM32_USB_USB1_HP_IRQ_PRIORITY) || defined(__DOXYGEN__)
+#if (!defined(STM32_USB_USB1_HP_IRQ_PRIORITY) && \
+ (STM32_USB1_HP_NUMBER != STM32_USB1_LP_NUMBER)) || defined(__DOXYGEN__)
#define STM32_USB_USB1_HP_IRQ_PRIORITY 13
#endif
@@ -95,6 +96,7 @@ #endif
#if STM32_USB_USE_USB1 && \
+ (STM32_USB1_HP_NUMBER != STM32_USB1_LP_NUMBER) && \
!CORTEX_IS_VALID_KERNEL_PRIORITY(STM32_USB_USB1_HP_IRQ_PRIORITY)
#error "Invalid IRQ priority assigned to USB HP"
#endif
diff --git a/testhal/STM32/STM32F0xx/USB_CDC/mcuconf.h b/testhal/STM32/STM32F0xx/USB_CDC/mcuconf.h index fc28e745e..9f967fd6f 100644 --- a/testhal/STM32/STM32F0xx/USB_CDC/mcuconf.h +++ b/testhal/STM32/STM32F0xx/USB_CDC/mcuconf.h @@ -162,5 +162,4 @@ */
#define STM32_USB_USE_USB1 TRUE
#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
-#define STM32_USB_USB1_HP_IRQ_PRIORITY 2
#define STM32_USB_USB1_LP_IRQ_PRIORITY 3
diff --git a/testhal/STM32/STM32F0xx/USB_CDC/readme.txt b/testhal/STM32/STM32F0xx/USB_CDC/readme.txt index 39055f999..1b367fcb7 100644 --- a/testhal/STM32/STM32F0xx/USB_CDC/readme.txt +++ b/testhal/STM32/STM32F0xx/USB_CDC/readme.txt @@ -1,14 +1,14 @@ *****************************************************************************
-** ChibiOS/RT HAL - USB-CDC driver demo for STM32F30x. **
+** ChibiOS/RT HAL - USB-CDC driver demo for STM32F072. **
*****************************************************************************
** TARGET **
-The demo runs on an ST STM32F3-Discovery board.
+The demo runs on an ST STM32F072B-Discovery board.
** The Demo **
-The application demonstrates the use of the STM32F30x USB driver.
+The application demonstrates the use of the STM32F072 USB driver.
** Build Procedure **
|