From eabbd037f5f605a9ecf06185cd62594eb4564bce Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 1 May 2017 09:25:30 +0200 Subject: o Adding USB CDC code/support. --- stm32cubemx/Src/stm32f1xx_it.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'stm32cubemx/Src/stm32f1xx_it.c') diff --git a/stm32cubemx/Src/stm32f1xx_it.c b/stm32cubemx/Src/stm32f1xx_it.c index 473a07a..a71b015 100644 --- a/stm32cubemx/Src/stm32f1xx_it.c +++ b/stm32cubemx/Src/stm32f1xx_it.c @@ -36,10 +36,11 @@ #include "stm32f1xx_it.h" /* USER CODE BEGIN 0 */ - +#include "main.h" /* USER CODE END 0 */ /* External variables --------------------------------------------------------*/ +extern PCD_HandleTypeDef hpcd_USB_FS; extern DMA_HandleTypeDef hdma_tim1_ch1; extern TIM_HandleTypeDef htim1; @@ -199,13 +200,41 @@ void DMA1_Channel2_IRQHandler(void) /* USER CODE END DMA1_Channel2_IRQn 1 */ } +/** +* @brief This function handles USB high priority or CAN TX interrupts. +*/ +void USB_HP_CAN1_TX_IRQHandler(void) +{ + /* USER CODE BEGIN USB_HP_CAN1_TX_IRQn 0 */ + + /* USER CODE END USB_HP_CAN1_TX_IRQn 0 */ + HAL_PCD_IRQHandler(&hpcd_USB_FS); + /* USER CODE BEGIN USB_HP_CAN1_TX_IRQn 1 */ + + /* USER CODE END USB_HP_CAN1_TX_IRQn 1 */ +} + +/** +* @brief This function handles USB low priority or CAN RX0 interrupts. +*/ +void USB_LP_CAN1_RX0_IRQHandler(void) +{ + /* USER CODE BEGIN USB_LP_CAN1_RX0_IRQn 0 */ + + /* USER CODE END USB_LP_CAN1_RX0_IRQn 0 */ + HAL_PCD_IRQHandler(&hpcd_USB_FS); + /* USER CODE BEGIN USB_LP_CAN1_RX0_IRQn 1 */ + + /* USER CODE END USB_LP_CAN1_RX0_IRQn 1 */ +} + /** * @brief This function handles TIM1 trigger and commutation interrupts. */ void TIM1_TRG_COM_IRQHandler(void) { /* USER CODE BEGIN TIM1_TRG_COM_IRQn 0 */ - + it_tim1(&htim1); /* USER CODE END TIM1_TRG_COM_IRQn 0 */ HAL_TIM_IRQHandler(&htim1); /* USER CODE BEGIN TIM1_TRG_COM_IRQn 1 */ -- cgit v1.2.3