SPI接收数据 用了DMA2 0 和2 两个流 各用了一个缓存数组 我想做一个乒乓操作 想在 完成中断跳到另外一个流 不知道为啥跳不过去 求大神指导
void MYDMA(DMA_Stream_TypeDef *DMA_Streamx,u16 len) //DMA′«êä
{
DMA_Cmd(DMA_Streamx,DISABLE);
while(DMA_GetCmdStatus(DMA_Streamx)!=DISABLE){}
DMA_SetCurrDataCounter(DMA_Streamx,len);
DMA_Cmd(DMA_Streamx,ENABLE);
}
void DMA2_Stream2_IRQHandler(void) //DMAíê3éÖD¶Ï D2
{
//if(DMA_GetITStatus(DMA2_Stream2,DMA_IT_TC)==RESET){
DMA_ClearITPendingBit(DMA2_Stream2,DMA_IT_TC);
//MYDMA(DMA2_Stream0,50);
//DMA_ITConfig(DMA2_Stream2, DMA_IT_TC, DISABLE);
// DMA_ITConfig(DMA2_Stream0, DMA_IT_TC, ENABLE);
send_uart( (const char *)dma2,50 );
// DMA_Cmd(DMA2_Stream2,DISABLE);
MYDMA(DMA2_Stream0,50);
// LED_Off(GPIO_Pin_14);
//}
}
void DMA2_Stream0_IRQHandler(void) //DMAíê3éÖD¶Ï D1
{
// if(DMA_GetITStatus(DMA2_Stream0,DMA_IT_TC)==RESET){
// DMA_ClearITPendingBit(DMA2_Stream0,DMA_IT_TC);
DMA_ClearFlag(DMA2_Stream0,DMA_FLAG_TCIF0);
// DMA_ITConfig(DMA2_Stream0, DMA_IT_TC, DISABLE);
// DMA_ITConfig(DMA2_Stream2, DMA_IT_TC, ENABLE);
// DMA_Cmd(DMA2_Stream0,DISABLE);
send_uart( (const char *)dma1,50 );
//DMA_Cmd(DMA2_Stream0,DISABLE);
//
LED_On(GPIO_Pin_14);
//DMA_ClearITPendingBit(DMA2_Stream0,DMA_IT_TC);
// }
//DMA_Cmd(DMA2_Stream0,DISABLE);
MYDMA(DMA2_Stream2,50);
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>