fix 303, now works with usb
This commit is contained in:
+18
-17
@@ -86,32 +86,33 @@ void MX_USB_DEVICE_Init(void)
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN USB_IRQ */
|
||||
|
||||
/**
|
||||
* Common USB handler
|
||||
*/
|
||||
static void __attribute__((used)) BASE_USB_IRQHandler(void)
|
||||
{
|
||||
HAL_PCD_IRQHandler(&hpcd_USB_FS);
|
||||
}
|
||||
|
||||
|
||||
// Function from F103
|
||||
/**
|
||||
* @brief This function handles USB low priority or CAN RX0 interrupts.
|
||||
*/
|
||||
|
||||
// Function from F103
|
||||
void USB_LP_CAN1_RX0_IRQHandler(void) __attribute__((alias("USB_IRQHandler")));
|
||||
void USB_LP_CAN1_RX0_IRQHandler(void) __attribute__((alias("BASE_USB_IRQHandler")));
|
||||
|
||||
// Function for F303
|
||||
void USB_LP_CAN_RX0_IRQHandler(void) __attribute__((alias("USB_IRQHandler")));
|
||||
/**
|
||||
* @brief This function handles USB low priority or CAN_RX0 interrupts.
|
||||
*/
|
||||
void USB_LP_CAN_RX0_IRQHandler(void) __attribute__((alias("BASE_USB_IRQHandler")));
|
||||
|
||||
// Function for F072
|
||||
/**
|
||||
* @brief This function handles USB global interrupt / USB wake-up interrupt through EXTI line 18.
|
||||
*/
|
||||
|
||||
// Function from F072
|
||||
void USB_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN USB_IRQn 0 */
|
||||
|
||||
/* USER CODE END USB_IRQn 0 */
|
||||
HAL_PCD_IRQHandler(&hpcd_USB_FS);
|
||||
/* USER CODE BEGIN USB_IRQn 1 */
|
||||
|
||||
/* USER CODE END USB_IRQn 1 */
|
||||
}
|
||||
|
||||
void USB_IRQHandler(void) __attribute__((alias("BASE_USB_IRQHandler")));
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -96,6 +96,8 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle)
|
||||
PA12 ------> USB_DP
|
||||
*/
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
LL_GPIO_SetPinMode(GPIOA, LL_GPIO_PIN_11, LL_GPIO_MODE_ALTERNATE);
|
||||
LL_GPIO_SetPinMode(GPIOA, LL_GPIO_PIN_12, LL_GPIO_MODE_ALTERNATE);
|
||||
LL_GPIO_SetAFPin_8_15(GPIOA, LL_GPIO_PIN_11, LL_GPIO_AF_14);
|
||||
LL_GPIO_SetAFPin_8_15(GPIOA, LL_GPIO_PIN_12, LL_GPIO_AF_14);
|
||||
HAL_NVIC_SetPriority(USB_LP_CAN_RX0_IRQn, 5, 0);
|
||||
|
||||
Reference in New Issue
Block a user