All Due pins are now attached to a single ISR. How do I tell them apart?

So I need the ability to attach all digital pins of the DUE to a single interrupt, and be able to tell them apart when the ISR runs.

For example, the code for the interrupt will be similar to the following

void interruptRoutine(){
 int interruptedPin = getInterruptedPin();
 addToPrintQueue("Digital pin "+interruptedPin+" was interrupted");
}

What code would go into the getInterruptedPin() to return the pin which triggered the interrupt? Returning the interrupt vector would also be fine.

I believe you have to poll the pins and be aware there may be multiple pins creating the interrupt. You create the "vector".

Paul

Paul_KD7HB:
I believe you have to poll the pins and be aware there may be multiple pins creating the interrupt. You create the "vector".

Paul

I thought there was one vector for each pin?

The pin responsible for the interrupt is identified in the C file Winterrupts.

You could alter Winterrupts to save this pin number.

The pin responsible for the interrupt is identified in the C file Winterrupts.

That file relates the external interrupts to pins. That information will do OP no good.

I would question why you need so many interrupts , seems odd to need so many .
If the input is present for a short time , could you not just read all the digital inputs to determine which created the interrupt ?

just read the whole port, xor with the last value you read to see which pins have changed. It could
be more than one. You then just iterate over the bit mask to enumerate the changed pins.