File tree Expand file tree Collapse file tree 4 files changed +23
-0
lines changed
Expand file tree Collapse file tree 4 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ void TIM2_IRQHandler(void);
6666void TIM3_IRQHandler (void );
6767void I2C1_EV_IRQHandler (void );
6868void I2C1_ER_IRQHandler (void );
69+ void SPI1_IRQHandler (void );
6970void SPI2_IRQHandler (void );
7071void USART1_IRQHandler (void );
7172void USART3_IRQHandler (void );
Original file line number Diff line number Diff line change @@ -473,6 +473,9 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
473473
474474 __HAL_LINKDMA (hspi ,hdmatx ,hdma_spi1_tx );
475475
476+ /* SPI1 interrupt Init */
477+ HAL_NVIC_SetPriority (SPI1_IRQn , 6 , 0 );
478+ HAL_NVIC_EnableIRQ (SPI1_IRQn );
476479 /* USER CODE BEGIN SPI1_MspInit 1 */
477480
478481 /* USER CODE END SPI1_MspInit 1 */
@@ -636,6 +639,9 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
636639 /* SPI1 DMA DeInit */
637640 HAL_DMA_DeInit (hspi -> hdmarx );
638641 HAL_DMA_DeInit (hspi -> hdmatx );
642+
643+ /* SPI1 interrupt DeInit */
644+ HAL_NVIC_DisableIRQ (SPI1_IRQn );
639645 /* USER CODE BEGIN SPI1_MspDeInit 1 */
640646
641647 /* USER CODE END SPI1_MspDeInit 1 */
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ extern DMA_HandleTypeDef hdma_spi2_rx;
6767extern DMA_HandleTypeDef hdma_spi2_tx ;
6868extern DMA_HandleTypeDef hdma_spi3_rx ;
6969extern DMA_HandleTypeDef hdma_spi3_tx ;
70+ extern SPI_HandleTypeDef hspi1 ;
7071extern SPI_HandleTypeDef hspi2 ;
7172extern SPI_HandleTypeDef hspi3 ;
7273extern TIM_HandleTypeDef htim1 ;
@@ -366,6 +367,20 @@ void I2C1_ER_IRQHandler(void)
366367 /* USER CODE END I2C1_ER_IRQn 1 */
367368}
368369
370+ /**
371+ * @brief This function handles SPI1 global interrupt.
372+ */
373+ void SPI1_IRQHandler (void )
374+ {
375+ /* USER CODE BEGIN SPI1_IRQn 0 */
376+
377+ /* USER CODE END SPI1_IRQn 0 */
378+ HAL_SPI_IRQHandler (& hspi1 );
379+ /* USER CODE BEGIN SPI1_IRQn 1 */
380+
381+ /* USER CODE END SPI1_IRQn 1 */
382+ }
383+
369384/**
370385 * @brief This function handles SPI2 global interrupt.
371386 */
Original file line number Diff line number Diff line change @@ -339,6 +339,7 @@ NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:fa
339339NVIC.OTG_FS_IRQn=true\:14\:0\:true\:false\:true\:true\:true\:false\:true
340340NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false\:false
341341NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
342+ NVIC.SPI1_IRQn=true\:6\:0\:true\:false\:true\:true\:true\:true\:true
342343NVIC.SPI2_IRQn=true\:9\:0\:true\:false\:true\:true\:true\:true\:true
343344NVIC.SPI3_IRQn=true\:8\:0\:true\:false\:true\:true\:true\:true\:true
344345NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false
You can’t perform that action at this time.
0 commit comments