git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7619 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
gdisirio 2015-01-11 10:21:26 +00:00
parent c7c04a2dfd
commit e7f1c3bf72
4 changed files with 10 additions and 5 deletions

View File

@ -448,7 +448,9 @@ void usb_lld_start(USBDriver *usbp) {
STM32_USB->CNTR = CNTR_FRES; STM32_USB->CNTR = CNTR_FRES;
/* Enabling the USB IRQ vectors, this also gives enough time to allow /* Enabling the USB IRQ vectors, this also gives enough time to allow
the transceiver power up (1uS).*/ 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); nvicEnableVector(STM32_USB1_HP_NUMBER, STM32_USB_USB1_HP_IRQ_PRIORITY);
#endif
nvicEnableVector(STM32_USB1_LP_NUMBER, STM32_USB_USB1_LP_IRQ_PRIORITY); nvicEnableVector(STM32_USB1_LP_NUMBER, STM32_USB_USB1_LP_IRQ_PRIORITY);
/* Releases the USB reset.*/ /* Releases the USB reset.*/
STM32_USB->CNTR = 0; STM32_USB->CNTR = 0;
@ -473,7 +475,9 @@ void usb_lld_stop(USBDriver *usbp) {
if (usbp->state == USB_STOP) { if (usbp->state == USB_STOP) {
#if STM32_USB_USE_USB1 #if STM32_USB_USE_USB1
if (&USBD1 == usbp) { if (&USBD1 == usbp) {
#if STM32_USB1_HP_NUMBER != STM32_USB1_LP_NUMBER
nvicDisableVector(STM32_USB1_HP_NUMBER); nvicDisableVector(STM32_USB1_HP_NUMBER);
#endif
nvicDisableVector(STM32_USB1_LP_NUMBER); nvicDisableVector(STM32_USB1_LP_NUMBER);
STM32_USB->CNTR = CNTR_PDWN | CNTR_FRES; STM32_USB->CNTR = CNTR_PDWN | CNTR_FRES;
rccDisableUSB(FALSE); rccDisableUSB(FALSE);

View File

@ -71,7 +71,8 @@
/** /**
* @brief USB1 interrupt priority level setting. * @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 #define STM32_USB_USB1_HP_IRQ_PRIORITY 13
#endif #endif
@ -95,6 +96,7 @@
#endif #endif
#if STM32_USB_USE_USB1 && \ #if STM32_USB_USE_USB1 && \
(STM32_USB1_HP_NUMBER != STM32_USB1_LP_NUMBER) && \
!CORTEX_IS_VALID_KERNEL_PRIORITY(STM32_USB_USB1_HP_IRQ_PRIORITY) !CORTEX_IS_VALID_KERNEL_PRIORITY(STM32_USB_USB1_HP_IRQ_PRIORITY)
#error "Invalid IRQ priority assigned to USB HP" #error "Invalid IRQ priority assigned to USB HP"
#endif #endif

View File

@ -162,5 +162,4 @@
*/ */
#define STM32_USB_USE_USB1 TRUE #define STM32_USB_USE_USB1 TRUE
#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE #define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
#define STM32_USB_USB1_HP_IRQ_PRIORITY 2
#define STM32_USB_USB1_LP_IRQ_PRIORITY 3 #define STM32_USB_USB1_LP_IRQ_PRIORITY 3

View File

@ -1,14 +1,14 @@
***************************************************************************** *****************************************************************************
** ChibiOS/RT HAL - USB-CDC driver demo for STM32F30x. ** ** ChibiOS/RT HAL - USB-CDC driver demo for STM32F072. **
***************************************************************************** *****************************************************************************
** TARGET ** ** TARGET **
The demo runs on an ST STM32F3-Discovery board. The demo runs on an ST STM32F072B-Discovery board.
** The Demo ** ** The Demo **
The application demonstrates the use of the STM32F30x USB driver. The application demonstrates the use of the STM32F072 USB driver.
** Build Procedure ** ** Build Procedure **