If you're just going to be sitting in a loop waiting for an interrupt to happen, you might as well poll the state of your input pin. Your code is flawed. I see no ON INTERRUPT statement, no RESUME and no logical path to follow. But if you simply need an answer "Can I change the state of the Interrupt Trigger from High to Low, or Low to High dynamically within my program", then the answer is Yes - absolutely.
A lot of folks seem to want to use interrupts simply because they "think" that's the way to go or seen other talk about it for a similar application. Not so. If you have a Keyboard Button Push, or even a Trigger on a Paintball or Laser gun, as long as your PIC isn't in SLEEP mode and you can poll the event within say 50mS for a trigger, or 100mS for a Keyboard Button, then nobody is going to be any the wiser. You don't need 1uS reaction time in 99.9% of applications.
Bookmarks