我的时钟中断程序如下:
在中断中先清了状态位,再重新设置了时间值。
现象还是只进入一次。
void handle_timer_interrupt()
{
IOWR_ALTERA_AVALON_TIMER_STATUS(TIMER_0_BASE, 0);
IOWR_ALTERA_AVALON_TIMER_PERIODL(TIMER_0_BASE,0xf080);
IOWR_ALTERA_AVALON_TIMER_PERIODH(TIMER_0_BASE,0x02fa);
IOWR_ALTERA_AVALON_TIMER_CONTROL(TIMER_0_BASE,0x07);
IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, ~led);
}
void init_time()
{
IOWR_ALTERA_AVALON_TIMER_CONTROL(TIMER_0_BASE,0x07);
alt_irq_register( TIMER_0_IRQ,
NULL,
handle_timer_interrupt
); |