summaryrefslogtreecommitdiffstatshomepage
path: root/stm/lib/usb_bsp.c
diff options
context:
space:
mode:
authorDamien <damien.p.george@gmail.com>2013-10-19 18:13:48 +0100
committerDamien <damien.p.george@gmail.com>2013-10-19 18:13:48 +0100
commitafe12bca23b106a18796bf6ed793ff1389bdddb2 (patch)
treec34020314b3b1ed7a6106a3582882460471ef1dc /stm/lib/usb_bsp.c
parentfb42ec17bcf7508f66b8d8d0770b60c33be0d6ab (diff)
downloadmicropython-afe12bca23b106a18796bf6ed793ff1389bdddb2.tar.gz
micropython-afe12bca23b106a18796bf6ed793ff1389bdddb2.zip
Fix IRQ priority issue to give working USB; and some cleanup.
Diffstat (limited to 'stm/lib/usb_bsp.c')
-rw-r--r--stm/lib/usb_bsp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/stm/lib/usb_bsp.c b/stm/lib/usb_bsp.c
index 293ee95e20..c4839bdf96 100644
--- a/stm/lib/usb_bsp.c
+++ b/stm/lib/usb_bsp.c
@@ -106,8 +106,8 @@ void USB_OTG_BSP_Init(USB_OTG_CORE_HANDLE *pdev) {
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
GPIO_Init(GPIOA, &GPIO_InitStructure);
- GPIO_PinAFConfig(GPIOA, GPIO_PinSource11, GPIO_AF_OTG1_FS);
- GPIO_PinAFConfig(GPIOA, GPIO_PinSource12, GPIO_AF_OTG1_FS);
+ GPIO_PinAFConfig(GPIOA, GPIO_PinSource11, GPIO_AF_OTG_FS);
+ GPIO_PinAFConfig(GPIOA, GPIO_PinSource12, GPIO_AF_OTG_FS);
/* Configure VBUS Pin (or disable VBUS_SENSING_ENABLED) */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
@@ -123,16 +123,16 @@ void USB_OTG_BSP_Init(USB_OTG_CORE_HANDLE *pdev) {
/**
* @brief USB_OTG_BSP_EnableInterrupt
-* Enabele USB Global interrupt
+* Enable USB Global interrupt
* @param None
* @retval None
*/
void USB_OTG_BSP_EnableInterrupt(USB_OTG_CORE_HANDLE *pdev) {
+ // this assumes we use NVIC_PriorityGroup_4
NVIC_InitTypeDef NVIC_InitStructure;
- NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
NVIC_InitStructure.NVIC_IRQChannel = OTG_FS_IRQn;
- NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
- NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3;
+ NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 8;
+ NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}