From 10fdafbcb2dfdb87af5aadea13f0138b85891d59 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Mon, 20 Apr 2009 18:38:45 -0400 Subject: [PATCH] initial isr. has problems. --- include/isr.h | 22 ++++++++++++++++++++++ src/isr.c | 20 ++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 include/isr.h create mode 100644 src/isr.c diff --git a/include/isr.h b/include/isr.h new file mode 100644 index 000000000..4939d42c4 --- /dev/null +++ b/include/isr.h @@ -0,0 +1,22 @@ +#ifndef ISR_H +#define ISR_H + +#include "embedded_types.h" + +#define INTBASE (0x80020000) +#define INTENNUM_OFF (0x8) +#define INTSRC_OFF (0x30) + +#define INTENNUM INTBASE + INTENNUM_OFF +#define INTSRC INTBASE + INTSRC_OFF + + +#define no_isrs() no_tmr_isr(); + +#define enable_tmr_irq() *(volatile uint32_t *)(INTENNUM) +#define no_tmr_isr() void tmr_isr(void) { return; } + +extern void tmr_isr(void); + +#endif + diff --git a/src/isr.c b/src/isr.c new file mode 100644 index 000000000..5b27130a0 --- /dev/null +++ b/src/isr.c @@ -0,0 +1,20 @@ +#include "embedded_types.h" +#include "interrupt-utils.h" +#include "isr.h" + +#define reg32(x) (*(volatile uint32_t *)(x)) + +__attribute__ ((interrupt("IRQ"))) +void isr(void) +{ +// ISR_ENTRY(); + /* check for TMR0 interrupt */ +// tmr_isr(); // led turns off if I have this, indicating that the isr does jump to tmr_isr +// if(reg32(INTSRC) & (1<<5)) { tmr_isr(); } +// asm("SUBS PC,R14_IRQ,#4") +// enableIRQ(); // I think this is necessary, but the LED never turns off when I have this +// ISR_EXIT(); // behavior doesn't change if I have this or not. + +/* putting anything in here breaks the other code :( */ + +}