Hi,
I can´t help with the compiler / simulator error.
*****
ISR:
* you check the TMRInterruptFlag. So far so good. You probably do this to distinguish if any other interrrupt occured.
Now let´s imagine INDEED any other interrupt occured. What happens then? And what happens when you don´t clear this (other) interrupt flag?
I have no experience with PICs, so I don´t know.
(maybe it restarts the ISR immedately after leaving, maybe it stops ISR form being called) So, to be on the safe side, I´d probably clear ALL interrupt flags when leaving the ISR.
Or even better: I´d save the flags into a register ... and clear all flags by_using_this_register at the very beginning of the ISR.
So you still have the flags in your register ... while you don´t lose an interrupt that occurs while you are processing the ISR.
This is not very critical when your ISR only processes one interrupt source .. but for the future, for expansions, for other applications...
Klaus