Interrupts

Has anyone tried to use the interrupt functionality of the WPILib directly? Let me see if I have this straight:

  • There are six interrupts available on GPIOs 1-6 [source - page 59]](http://users.wpi.edu/~bamiller/WPILib/WPILib.pdf) However, if that’s true, why can we attach a encoder anywhere?
  • To get a function called whenever the pin changes state, the function RegisterInterruptHandler must be called
  • No interrupts can happen while another is in progress.

Also, I was wondering about calling a Relay.Set() function in an interrupt - would that take too long? How would it be possible if the relay was a private member of the class?

Thanks!

The WPILib document you referenced is for the IFI system.

Oh okay, thanks. I was expecting something like that. Is there another document that shows how to use interrupts? I am starting to piece things together, but it would be helpful if someone who has done this would share their experiences.

Specific question:
I just looked at the tInterruptHandler typedef, and I’m wondering what interruptAssertedMask would pass.

Have you looked at the InterruptibleSensorBase class yet? It is a base class for the DigitalInput class. You can choose to block until the interrupt or register a callback on interrupt (based on which version of RequestInterrupts() you call).

-Joe