I'd like to know at what point the an interrupt flag is cleared when the datasheet says 'the flag is cleared when the interrupt routine is executed'.
The reason for the question is a toggling port pin using the pin change interrupt. If the pin toggles and an interrupt is generated, while servicing that interrupt if the pin toggles again as I'm leaving the interrupt, will I miss it? If the interrupt flag is cleared upon entry into the ISR, I don't have a problem. If it is cleared by the reti, I could miss the interrupt.
I guess one way would be to write some code and test it for myself, but if anyone out there already knows the answer, please share it.