Forum Discussion
Altera_Forum
Honored Contributor
13 years agoI have two timers:
- the timer with IRQ2 has a 1ms period (the only interrupt I see came from this timer) - the timer with IRQ3 also has a 1ms period (surprisingly enough, I never saw this timer trigger an interrupt?) (edit): the IRQ2-timer is also set as the sys_clk_timer in the altera BSP editor the interrupt handler I use in the moment, is the stock interrupt handler provided by the altera BSP: - alt_irq_handler() in alt_irq_handler.c here a shortened snippet from alt_irq_handler: active = alt_irq_pending ();
do {
i = 0;
mask = 1;
do {
if (active & mask) {
alt_irq.handler(alt_irq.context);
break;
}
mask <<= 1;
i++;
} while (1);
active = alt_irq_pending ();
} while (active);
ALT_OS_INT_EXIT();
the called handler for this particular IRQ is alt_avalon_timer_sc_irq (void* base) in alt_avalon_timer_sc.c shortened snippet of the code: IOWR_ALTERA_AVALON_TIMER_STATUS (base, 0);
IORD_ALTERA_AVALON_TIMER_CONTROL (base);
ALT_LOG_SYS_CLK_HEARTBEAT();
cpu_sr = alt_irq_disable_all();
alt_tick ();
alt_irq_enable_all(cpu_sr);
for the time being, my main() function does nothing else than controlling the blinking of an LED