aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/OTGv1
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-24 07:41:07 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-24 07:41:07 +0000
commitca6ab337feffdc0d6fddc492a91e55ebf197d4f5 (patch)
treef3774f2ca2e94ea5e3ca8e3055a7385a8accc9dd /os/hal/platforms/STM32/OTGv1
parent30400ff28785c156264fb97069b127e8dbfb7491 (diff)
downloadChibiOS-ca6ab337feffdc0d6fddc492a91e55ebf197d4f5.tar.gz
ChibiOS-ca6ab337feffdc0d6fddc492a91e55ebf197d4f5.tar.bz2
ChibiOS-ca6ab337feffdc0d6fddc492a91e55ebf197d4f5.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4343 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/OTGv1')
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.c9
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.h5
2 files changed, 11 insertions, 3 deletions
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c
index 68f4714fb..b4238a8a0 100644
--- a/os/hal/platforms/STM32/OTGv1/usb_lld.c
+++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c
@@ -532,12 +532,15 @@ static void otg_epout_handler(USBDriver *usbp, usbep_t ep) {
/*===========================================================================*/
#if STM32_USB_USE_OTG1 || defined(__DOXYGEN__)
+#if !defined(STM32_OTG1_HANDLER)
+#error "STM32_OTG1_HANDLER not defined"
+#endif
/**
* @brief OTG1 interrupt handler.
*
* @isr
*/
-CH_IRQ_HANDLER(OTG_FS_IRQHandler) {
+CH_IRQ_HANDLER(STM32_OTG1_HANDLER) {
USBDriver *usbp = &USBD1;
uint32_t sts;
@@ -631,7 +634,7 @@ void usb_lld_start(USBDriver *usbp) {
rccResetOTG_FS();
/* Enables IRQ vector.*/
- nvicEnableVector(OTG_FS_IRQn,
+ nvicEnableVector(STM32_OTG1_NUMBER,
CORTEX_PRIORITY_MASK(STM32_USB_OTG1_IRQ_PRIORITY));
}
#endif
@@ -686,7 +689,7 @@ void usb_lld_stop(USBDriver *usbp) {
if (usbp->state == USB_STOP) {
#if STM32_USB_USE_USB1
if (&USBD1 == usbp) {
- nvicDisableVector(OTG_FS_IRQn);
+ nvicDisableVector(STM32_OTG1_NUMBER);
rccDisableOTG1(FALSE);
}
#endif
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.h b/os/hal/platforms/STM32/OTGv1/usb_lld.h
index 23e41d6e8..f44f1591e 100644
--- a/os/hal/platforms/STM32/OTGv1/usb_lld.h
+++ b/os/hal/platforms/STM32/OTGv1/usb_lld.h
@@ -87,6 +87,11 @@
#error "USB driver activated but no USB peripheral assigned"
#endif
+#if STM32_USB_USE_OTG1 && \
+ !CORTEX_IS_VALID_KERNEL_PRIORITY(STM32_USB_OTG1_IRQ_PRIORITY)
+#error "Invalid IRQ priority assigned to OTG1"
+#endif
+
#if (STM32_USB_OTG1_RX_FIFO_SIZE & 3) != 0
#error "RX FIFO size must be a multiple of 4"
#endif