#4378 - jaholmes - Sat Mar 29, 2003 8:41 am
Ok, so I'm working on my first GBA project, and I'm a bit confused. Docs talk about saving and restoring REG_IME in your interrupt handler, but is that really a concern? For example, many demos don't do this (e.g., those that use Jeff F's Crt0.S with __FastInterrupts or __SingleInterrupts turned on and implement InterruptProcess in their C/C++ sources).
I've written some code that enables interrupts for timers 0 and 1, one set for twice the overflow rate of the other, and I don't see any nested interrupts happening. I've put hideous delay loops inside of InterruptProcess, but a nested interrupt simply never happens. Am I missing something?
Seems to me that, if you're NOT aiming to allow nested interrupts and NOT using __MultipleInterrupts, your interrupt handler ought to be as simple as:
void InterruptProcess() {
//
// <-- do whatever you want based on REG_IF;
//
REG_IF=REG_IF; // acknowledge all interrupts
}
All of my experiments seem to indicate this is fine, but I'm more interested in hard facts :)
Regards,
Aaron
BTW: THANKS LUNA_S!!! ... for fixing my registration. This is my first post, so "hello" all around. I'm jazzed to be getting started here.
I've written some code that enables interrupts for timers 0 and 1, one set for twice the overflow rate of the other, and I don't see any nested interrupts happening. I've put hideous delay loops inside of InterruptProcess, but a nested interrupt simply never happens. Am I missing something?
Seems to me that, if you're NOT aiming to allow nested interrupts and NOT using __MultipleInterrupts, your interrupt handler ought to be as simple as:
void InterruptProcess() {
//
// <-- do whatever you want based on REG_IF;
//
REG_IF=REG_IF; // acknowledge all interrupts
}
All of my experiments seem to indicate this is fine, but I'm more interested in hard facts :)
Regards,
Aaron
BTW: THANKS LUNA_S!!! ... for fixing my registration. This is my first post, so "hello" all around. I'm jazzed to be getting started here.