From 2ae6881a67a6f8441ba95ab7dd44b87f4f79e998 Mon Sep 17 00:00:00 2001 From: Olaf Rempel Date: Tue, 4 Mar 2008 23:38:18 +0100 Subject: [PATCH] reset AIC - finally working --- at91_init1.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/at91_init1.c b/at91_init1.c index 7011989..5aebe44 100644 --- a/at91_init1.c +++ b/at91_init1.c @@ -70,10 +70,6 @@ void at91_init1(void) aic->AIC_IDCR = ~0; aic->AIC_ICCR = ~0; - /* end-of-interrupt signal */ - while (aic->AIC_ISR != 0x00) - aic->AIC_EOICR = ~0; - /* default Interrupt Handlers just return */ aic->AIC_FVR = (uint32_t)empty_isr; aic->AIC_IVR = (uint32_t)empty_isr; @@ -83,6 +79,11 @@ void at91_init1(void) aic->AIC_SVR[i] = (uint32_t)empty_isr; } aic->AIC_SPU = (uint32_t)empty_isr; + + /* end-of-interrupt signal */ + do { + aic->AIC_EOICR = ~0; + } while (aic->AIC_ISR != 0x00); } __attribute__((naked)) void IRQ_Handler(void)