Hi,
Two ways to do this
-
Have a mode variable and just ignore the RC Pulses when you don't need them
-
Detach the interrupts using void PCintPort::detachInterrupt(uint8_t arduinoPin)
In and ideal world option 2 would be your best choice, but in Arduino this is not a good choice - it uses the delete function to free the pin memory, this function is not properly supported on Arduino so every time you attach an detach pins a small amount of memory is used up that you sketch cannot use again until it is reset - technically its know as a memory leak.
Option 1 is easy to do and just means that you sketch will be about 1% less efficient.
A third option is to disable individual interrupt flags - but lets not get into that because 1) is easy and has so little impact on your sketch that you will not notice.
so wrap the code in something like this -
if(gMode == RC_CONTROL)
{
read channels
update channels
}
this way the RC Code will only be processed when your sketch sets gMode to RC_CONTROL
Duane B