const Timer_A_UpModeConfig upConfig =
{
TIMER_A_CLOCKSOURCE_SMCLK,
TIMER_A_CLOCKSOURCE_DIVIDER_1,
TIMER_PERIOD,
TIMER_A_TAIE_INTERRUPT_ENABLE,
TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE,
TIMER_A_DO_CLEAR
}; //配置了向上模式TAIE和CCR0中断都开了。
主函数里是这样写的
MAP_Timer_A_configureUpMode(TIMER_A1_MODULE, &upConfig);
MAP_Timer_A_startCounter(TIMER_A1_MODULE, TIMER_A_UP_MODE);
中断程序
void TA1_isr()
{ MAP_Timer_A_clearInterruptFlag(TIMER_A1_MODULE);
MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A1_MODULE,
TIMER_A_CAPTURECOMPARE_REGISTER_0);
MAP_GPIO_setAsOutputPin(GPIO_PORT_P1,GPIO_PIN0);
MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P1,GPIO_PIN0);
}
但是程序运行时跑到这里了
void CPU_wfi(void) { // // Wait for the next interrupt. // __asm(" wfi\n"); } #endif 谁能解释一下??? |