I know that it's not adding much code, but can you remove (comment out) your debug statements, like above? I noticed there are more below, too.
Right, they are only there so I can actually scope it at the hardware level.
I've also run it in sim with studio, and it shows the same latency.
I'm less concerned with the time the ISR takes than I am with the time it takes to actually get started.
The first half is more critical, the last half is pretty much a "don't care", as long as the timer value is caught quickly.
If the latency to that point is constant, then it's not an issue, and I can factor it out.
>Your assignment into an array seems to generate a lot of code. Is there any way that you can just use some dedicated global variables
>while in the ISR, and then stuff values to an array during a task in the main loop?
I could but this is in the part where I don't really care.. If I miss subsequent pulses, that's not an issue.
>GICR = ((GICR & ~(1<<INT0)) | (1 << INT1));
>I would think this would compile to an IN,ANDI,ORI,OUT sequence
Ok, that's a good tip. This is only my second program in C, so of course I'm going to be ignorant of such things.
If we can keep the ISR from using as many other registers as possible, then it will help in both the ISR prologue and epilogue.
It irritates me to no end that C pushes registers that aren't even USED...