This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
hal_IRQ_handler() for AT91 port
Hi Gary!
Why did you make :
in at91_misc.c
int hal_IRQ_handler(void)
{
cyg_uint32 irq_num;
cyg_uint32 ipr, imr;
HAL_READ_UINT32(AT91_AIC+AT91_AIC_IPR, ipr);
HAL_READ_UINT32(AT91_AIC+AT91_AIC_IMR, imr);
ipr &= imr;
for (irq_num = 0; irq_num < 19; irq_num++) {
if (ipr & (1 << irq_num)) {
break;
}
}
return irq_num;
}
instead of (whitout loop):
int hal_IRQ_handler(void)
{
// Do hardware-level IRQ handling
int vector;
vector = AIC->AIC_IVR; // Acknoledge interupt (Reads as 0)
vector = AIC->AIC_ISR; // Read interupt vector
return vector;
}
best regards
Ilko