void Timer0_Callback(void) { TimerIntClear(GPT0_BASE, TIMER_TIMA_TIMEOUT);//清空中断 GPIO_toggle(Board_GPIO_LED0); } void Timer0_Init(void) { // Power on the TIMER0 peripheral PRCMPeripheralRunEnable(PRCM_PERIPH_TIMER0); TimerDisable(GPT0_BASE, TIMER_A); TimerConfigure(GPT0_BASE, TIMER_CFG_SPLIT_PAIR |TIMER_CFG_A_PERIODIC_UP); TimerLoadSet(GPT0_BASE, TIMER_A, 200); TimerPrescaleSet(GPT0_BASE, TIMER_A, 48-1);//实际分频值加1 //TimerIntervalLoadMode(GPT0_BASE, TIMER_A, TIMER_INTERVALLOAD_NEXTCYCLE);//更新模式:在下个时钟周期 TimerIntRegister(GPT0_BASE, TIMER_A, Timer0_Callback); TimerIntEnable(GPT0_BASE, TIMER_TIMA_TIMEOUT); TimerIntClear(GPT0_BASE, TIMER_TIMA_TIMEOUT);//清空中断 TimerEnable(GPT0_BASE, TIMER_A); }
请问这段代码定时器时间视乎不起作用,一直是63.9ms,改LOAD值定时时间也不变,不知是哪的问题。