More updates for the STM32F3Discovery

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5617 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2013-02-06 23:09:09 +00:00
parent 21a6a31fad
commit 2440416bdc
4 changed files with 22 additions and 20 deletions

View File

@ -267,6 +267,13 @@
# define STM32_IRQ_DMA2CH3 (74) /* 58: DMA2 Channel 3 global interrupt */
# define STM32_IRQ_DMA2CH45 (75) /* 59: DMA2 Channel 4&5 global interrupt */
# define NR_IRQS (76)
/* Convenience definitions for interrupts with multiple functions */
# define STM32_IRQ_USBHP STM32_IRQ_USBHPCANTX
# define STM32_IRQ_CAN1TX STM32_IRQ_USBHPCANTX
# define STM32_IRQ_USBLP STM32_IRQ_USBLPCANRX0
# define STM32_IRQ_CAN1RX0 STM32_IRQ_USBLPCANRX0
#endif
/************************************************************************************

View File

@ -442,7 +442,7 @@ config STM32_SPI3
config STM32_SYSCFG
bool "SYSCFG"
default y
depends on STM32_STM32F20XX || STM32_STM32F40XX
depends on STM32_STM32F30XX || STM32_STM32F20XX || STM32_STM32F40XX
config STM32_TIM1
bool "TIM1"

View File

@ -175,13 +175,8 @@ static const struct can_ops_s g_canops =
static struct stm32_can_s g_can1priv =
{
.port = 1,
#if defined(CONFIG_STM32_STM32F10XX) && !defined(CONFIG_STM32_CONNECTIVITYLINE)
.canrx0 = STM32_IRQ_USBLPCANRX0,
.cantx = STM32_IRQ_USBHPCANTX,
#else
.canrx0 = STM32_IRQ_CAN1RX0,
.cantx = STM32_IRQ_CAN1TX,
#endif
.filter = 0,
.base = STM32_CAN1_BASE,
.baud = CONFIG_CAN1_BAUD,

View File

@ -3476,17 +3476,17 @@ void up_usbinitialize(void)
* them when we need them later.
*/
if (irq_attach(STM32_IRQ_USBHPCANTX, stm32_hpinterrupt) != 0)
if (irq_attach(STM32_IRQ_USBHP, stm32_hpinterrupt) != 0)
{
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_IRQREGISTRATION),
(uint16_t)STM32_IRQ_USBHPCANTX);
(uint16_t)STM32_IRQ_USBHP);
goto errout;
}
if (irq_attach(STM32_IRQ_USBLPCANRX0, stm32_lpinterrupt) != 0)
if (irq_attach(STM32_IRQ_USBLP, stm32_lpinterrupt) != 0)
{
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_IRQREGISTRATION),
(uint16_t)STM32_IRQ_USBLPCANRX0);
(uint16_t)STM32_IRQ_USBLP);
goto errout;
}
return;
@ -3522,10 +3522,10 @@ void up_usbuninitialize(void)
/* Disable and detach the USB IRQs */
up_disable_irq(STM32_IRQ_USBHPCANTX);
up_disable_irq(STM32_IRQ_USBLPCANRX0);
irq_detach(STM32_IRQ_USBHPCANTX);
irq_detach(STM32_IRQ_USBLPCANRX0);
up_disable_irq(STM32_IRQ_USBHP);
up_disable_irq(STM32_IRQ_USBLP);
irq_detach(STM32_IRQ_USBHP);
irq_detach(STM32_IRQ_USBLP);
if (priv->driver)
{
@ -3595,13 +3595,13 @@ int usbdev_register(struct usbdevclass_driver_s *driver)
/* Enable USB controller interrupts at the NVIC */
up_enable_irq(STM32_IRQ_USBHPCANTX);
up_enable_irq(STM32_IRQ_USBLPCANRX0);
up_enable_irq(STM32_IRQ_USBHP);
up_enable_irq(STM32_IRQ_USBLP);
/* Set the interrrupt priority */
up_prioritize_irq(STM32_IRQ_USBHPCANTX, CONFIG_USB_PRI);
up_prioritize_irq(STM32_IRQ_USBLPCANRX0, CONFIG_USB_PRI);
up_prioritize_irq(STM32_IRQ_USBHP, CONFIG_USB_PRI);
up_prioritize_irq(STM32_IRQ_USBLP, CONFIG_USB_PRI);
/* Enable pull-up to connect the device. The host should enumerate us
* some time after this
@ -3657,8 +3657,8 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver)
/* Disable USB controller interrupts (but keep them attached) */
up_disable_irq(STM32_IRQ_USBHPCANTX);
up_disable_irq(STM32_IRQ_USBLPCANRX0);
up_disable_irq(STM32_IRQ_USBHP);
up_disable_irq(STM32_IRQ_USBLP);
/* Put the hardware in an inactive state. Then bring the hardware back up
* in the reset state (this is probably not necessary, the stm32_reset()