Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Interrupts (http://www.chiefdelphi.com/forums/showthread.php?t=98488)

WizenedEE 27-11-2011 22:32

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] 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!

Joe Ross 27-11-2011 23:54

Re: Interrupts
 
Quote:

Originally Posted by WizenedEE (Post 1087039)
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] 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.

WizenedEE 28-11-2011 02:10

Re: Interrupts
 
Quote:

Originally Posted by Joe Ross (Post 1087053)
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.

jhersh 29-11-2011 17:18

Re: Interrupts
 
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


All times are GMT -5. The time now is 17:45.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi