thomas haine
/
CIS001_v2_v2
cis001v2
Diff: stm32h7xx_hal_msp.cpp
- Revision:
- 8:66caa906d24c
- Parent:
- 0:e7352f4f3dcb
--- a/stm32h7xx_hal_msp.cpp Wed Jan 06 13:35:17 2021 +0000 +++ b/stm32h7xx_hal_msp.cpp Wed Feb 10 16:38:32 2021 +0000 @@ -39,6 +39,26 @@ { __HAL_RCC_SYSCFG_CLK_ENABLE(); + + HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_2); + //HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); + + // System interrupt init + // MemoryManagement_IRQn interrupt configuration + HAL_NVIC_SetPriority(MemoryManagement_IRQn, 0, 0); + // BusFault_IRQn interrupt configuration + HAL_NVIC_SetPriority(BusFault_IRQn, 0, 0); + // UsageFault_IRQn interrupt configuration + HAL_NVIC_SetPriority(UsageFault_IRQn, 0, 0); + // SVCall_IRQn interrupt configuration + HAL_NVIC_SetPriority(SVCall_IRQn, 0, 0); + // DebugMonitor_IRQn interrupt configuration + HAL_NVIC_SetPriority(DebugMonitor_IRQn, 0, 0); + // PendSV_IRQn interrupt configuration + HAL_NVIC_SetPriority(PendSV_IRQn, 0, 0); + // SysTick_IRQn interrupt configuration + HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); + } @@ -127,27 +147,36 @@ /* DCMI DMA Init */ /* DCMI_PSSI Init */ - hdma_dcmi.Instance = DMA1_Stream0; - //hdma_dcmi.Init.Request = DMA_REQUEST_DCMI_PSSI; - hdma_dcmi.Init.Direction = DMA_PERIPH_TO_MEMORY; - hdma_dcmi.Init.PeriphInc = DMA_PINC_DISABLE; - hdma_dcmi.Init.MemInc = DMA_MINC_ENABLE; - hdma_dcmi.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; - hdma_dcmi.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; - hdma_dcmi.Init.Mode = DMA_CIRCULAR; - hdma_dcmi.Init.Priority = DMA_PRIORITY_HIGH; - hdma_dcmi.Init.FIFOMode = DMA_FIFOMODE_ENABLE; - hdma_dcmi.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; - hdma_dcmi.Init.MemBurst = DMA_MBURST_INC4; - hdma_dcmi.Init.PeriphBurst = DMA_PBURST_SINGLE; + hdma_dcmi.Instance = DMA1_Stream0; + hdma_dcmi.Init.Request = DMA_REQUEST_DCMI; + hdma_dcmi.Init.Direction = DMA_PERIPH_TO_MEMORY; + hdma_dcmi.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_dcmi.Init.MemInc = DMA_MINC_ENABLE; + hdma_dcmi.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; + hdma_dcmi.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; + hdma_dcmi.Init.Mode = DMA_CIRCULAR; + hdma_dcmi.Init.Priority = DMA_PRIORITY_HIGH; + hdma_dcmi.Init.FIFOMode = DMA_FIFOMODE_ENABLE; + hdma_dcmi.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; + hdma_dcmi.Init.MemBurst = DMA_MBURST_INC4; + hdma_dcmi.Init.PeriphBurst = DMA_PBURST_SINGLE; if (HAL_DMA_Init(&hdma_dcmi) != HAL_OK) { Error_Handler(); } + __HAL_LINKDMA(hdcmi,DMA_Handle,hdma_dcmi); + + /* DCMI interrupt Init */ + //HAL_NVIC_SetPriority(DCMI_IRQn, 0x0F, 0); // 0 is highest priority + //HAL_NVIC_EnableIRQ(DCMI_IRQn); + + HAL_NVIC_SetPriority(DCMI_IRQn, 0x00, 0); + HAL_NVIC_EnableIRQ(DCMI_IRQn); /* USER CODE BEGIN DCMI_MspInit 1 */ /* USER CODE END DCMI_MspInit 1 */ + } }