Is there any memory record which store the external interrupt
activation?
There is, but I do not think it will be easy to exploit.
At low level, each interrupt is handled by a different ISR. So you will
have INT0_vect
handling external interrupt 0 and INT1_vect
handling interrupt 1. These ISRs are all defined by the Arduino
core library. In your case, they will both call the same handler that
you defined. Thus, the information about which ISR fired is now on the
stack: it is the return address of your function.
The reason this information will not be easy to use is that you do not
know how far it is from the stack pointer. It depends on how much stuff
your own handler pushed onto the stack. You could disassemble it and
count, but then your code will be fragile, as the smallest change in the
handler (or compiler version) may change this count.
An easier approach may be to define your own INT0_vect
and
INT1_vect
, overriding those from the Arduino core. These new ISRs
will both call your handler, but they will pass it an argument to tell
which interrupt fired.
Or you can register a different handler for each interrupt, each calling
a common function. But this adds an extra level of function calls.