Skip to content

Commit 4e73a9e

Browse files
committed
F407 Reenable SPI1 interrupt
1 parent edc8b62 commit 4e73a9e

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

Firmware/Targets/F407VG/Core/Inc/stm32f4xx_it.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ void TIM2_IRQHandler(void);
6666
void TIM3_IRQHandler(void);
6767
void I2C1_EV_IRQHandler(void);
6868
void I2C1_ER_IRQHandler(void);
69+
void SPI1_IRQHandler(void);
6970
void SPI2_IRQHandler(void);
7071
void USART1_IRQHandler(void);
7172
void USART3_IRQHandler(void);

Firmware/Targets/F407VG/Core/Src/stm32f4xx_hal_msp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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 */

Firmware/Targets/F407VG/Core/Src/stm32f4xx_it.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ extern DMA_HandleTypeDef hdma_spi2_rx;
6767
extern DMA_HandleTypeDef hdma_spi2_tx;
6868
extern DMA_HandleTypeDef hdma_spi3_rx;
6969
extern DMA_HandleTypeDef hdma_spi3_tx;
70+
extern SPI_HandleTypeDef hspi1;
7071
extern SPI_HandleTypeDef hspi2;
7172
extern SPI_HandleTypeDef hspi3;
7273
extern 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
*/

Firmware/Targets/F407VG/OpenFFBoard_F407VG.ioc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:fa
339339
NVIC.OTG_FS_IRQn=true\:14\:0\:true\:false\:true\:true\:true\:false\:true
340340
NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false\:false
341341
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
342+
NVIC.SPI1_IRQn=true\:6\:0\:true\:false\:true\:true\:true\:true\:true
342343
NVIC.SPI2_IRQn=true\:9\:0\:true\:false\:true\:true\:true\:true\:true
343344
NVIC.SPI3_IRQn=true\:8\:0\:true\:false\:true\:true\:true\:true\:true
344345
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false

0 commit comments

Comments
 (0)