code/WPILib/DigitalInput.cpp
/**
 * Request interrupts asynchronously on this digital input.
 * @param handler The address of the interrupt handler function of type tInterruptHandler that
 * will be called whenever there is an interrupt on the digitial input port.
 * Request interrupts in synchronus mode where the user program interrupt handler will be
 * called when an interrupt occurs.
 * The default is interrupt on rising edges only.
 */
Request interrupts asynchronously on this digital input.
@param handler The address of the interrupt handler function of type tInterruptHandler that
will be called whenever there is an interrupt on the digitial input port.
Request interrupts in synchronus mode where the user program interrupt handler will be
called when an interrupt occurs.
The default is interrupt on rising edges only.
Request interrupts asynchronously on this digital input . @param handler The address of the interrupt handler function of type tInterruptHandler that will be called whenever there is an interrupt on the digitial input port . Request interrupts in synchronus mode where the user program interrupt handler will be called when an interrupt occurs . The default is interrupt on rising edges only .
void DigitalInput::RequestInterrupts(tInterruptHandler handler, void *param)
{
	m_interruptIndex = interruptsResource->Allocate();
	AllocateInterrupts(false);
	m_interrupt->writeConfig_WaitForAck(false, &status);
	m_interrupt->writeConfig_Source_AnalogTrigger(GetAnalogTriggerForRouting(), &status);
	m_interrupt->writeConfig_Source_Channel(GetChannelForRouting(), &status);
	m_interrupt->writeConfig_Source_Module(GetModuleForRouting(), &status);
	SetUpSourceEdge(true, false);
	m_manager->registerHandler(handler, param, &status);
	wpi_assertCleanStatus(status);
}
void DigitalInput :: RequestInterrupts ( tInterruptHandler handler , void * param ) { m_interruptIndex = interruptsResource -> Allocate ( ) ; AllocateInterrupts ( false ) ; m_interrupt -> writeConfig_WaitForAck ( false , & status ) ; m_interrupt -> writeConfig_Source_AnalogTrigger ( GetAnalogTriggerForRouting ( ) , & status ) ; m_interrupt -> writeConfig_Source_Channel ( GetChannelForRouting ( ) , & status ) ; m_interrupt -> writeConfig_Source_Module ( GetModuleForRouting ( ) , & status ) ; SetUpSourceEdge ( true , false ) ; m_manager -> registerHandler ( handler , param , & status ) ; wpi_assertCleanStatus ( status ) ; }
Request interrupts asynchronously on this digital input.
Request interrupts asynchronously on this digital input .
//TODO: check for error on allocation // Creates a manager too