NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
/* Enable DMA1 channel1 IRQ Channel */
NVIC_InitStructure.NVIC_IRQChannel = DMA2_Channel4_5_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&Escalator12bit;
DMA_InitStructure.DMA_PeripheralBaseAddr = DAC_DHR12R2_Address;
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;
DMA_InitStructure.DMA_BufferSize = 200;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;//DMA_PeripheralDataSize_Byte;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;//DMA_MemoryDataSize_Byte;
DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
DMA_Init(DMA2_Channel4, &DMA_InitStructure);
DMA_ITConfig (DMA2_Channel4, DMA_IT_TC, ENABLE);
DMA_Cmd(DMA2_Channel4, ENABLE);
void BSP_IntHandlerDMA2_CH4_5 (void)
{
if (DMA_GetITStatus (DMA2_IT_TC4) == SET){
DMA_ClearITPendingBit (DMA2_IT_TC4);
printf ("aa\r\n");
}
printf ("aa\r\n");
}
请教下,为什么老是不进入中断?不知道那里配置错误,有没有那个高手慧眼看看。谢了。DMA有在跑,我弄得是正弦输出,有正弦波输出,就是不进入中断。:'(:'( |