问题补充 : 029sge程序:不能实现功能,卡在while
/* Enable PDMA clock source */
CLK_EnableModuleClock(PDMA_MODULE);
/* Open Channel 2 */
PDMA_Open(1 << 2);
/* Transfer count is PDMA_TEST_LENGTH, transfer width is 32 bits(one word) */
PDMA_SetTransferCnt(2, PDMA_WIDTH_32, buffersize);
/* Set source address is au8SrcArray, destination address is au8DestArray, Source/Destination increment size is 32 bits(one word) */
PDMA_SetTransferAddr(2, (uint32_t)LED_BYTE_Buffer, PDMA_SAR_INC, (uint32_t)(&(TIMER1 -> PWMCMPDAT)), PDMA_DAR_FIX);
/* Request source is memory to TMR1 */
PDMA_SetTransferMode(2, PDMA_TMR1, FALSE, 0);
/* Transfer type is burst transfer and burst size is 1 */
PDMA_SetBurstType(2, PDMA_REQ_BURST, PDMA_BURST_1);
TPWM_CLEAR_COUNTER(TIMER1);
/* Start Timer PWM counter */
TPWM_START_COUNTER(TIMER1);
/* Generate a software request to trigger transfer with PDMA channel 2 */
PDMA_Trigger(2);
while(!(PDMA_GET_TD_STS() & PDMA_TDSTS_TDIF2_Msk));
TPWM_STOP_COUNTER(TIMER1);
/* Clear transfer done flag of channel 2 */
PDMA_CLR_TD_FLAG(PDMA_TDSTS_TDIF2_Msk);
|