mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-06 03:31:43 +00:00
Analog interrupts in C++
Analog interrupts now work in C++. The interrupts Resource was moved from a global in DigitalInput to a static member of SensorBase. An analog interrupt IT was added, and the digital interrupt one modified to prevent a linker error. Change-Id: I9a300daafed15e9666a4ccb405a509615e3dbb06
This commit is contained in:
@@ -9,8 +9,6 @@
|
||||
#include "Resource.h"
|
||||
#include "WPIErrors.h"
|
||||
|
||||
extern Resource *interruptsResource;
|
||||
|
||||
/**
|
||||
* Create an instance of a DigitalOutput.
|
||||
* Creates a digital output given a channel. Common creation routine for all
|
||||
@@ -235,10 +233,10 @@ bool DigitalOutput::GetAnalogTriggerForRouting()
|
||||
void DigitalOutput::RequestInterrupts(InterruptHandlerFunction handler, void *param)
|
||||
{
|
||||
if (StatusIsFatal()) return;
|
||||
uint32_t index = interruptsResource->Allocate("Sync Interrupt");
|
||||
uint32_t index = m_interrupts->Allocate("Sync Interrupt");
|
||||
if (index == ~0ul)
|
||||
{
|
||||
CloneError(interruptsResource);
|
||||
CloneError(m_interrupts);
|
||||
return;
|
||||
}
|
||||
m_interruptIndex = index;
|
||||
@@ -263,10 +261,10 @@ void DigitalOutput::RequestInterrupts(InterruptHandlerFunction handler, void *pa
|
||||
void DigitalOutput::RequestInterrupts()
|
||||
{
|
||||
if (StatusIsFatal()) return;
|
||||
uint32_t index = interruptsResource->Allocate("Sync Interrupt");
|
||||
uint32_t index = m_interrupts->Allocate("Sync Interrupt");
|
||||
if (index == ~0ul)
|
||||
{
|
||||
CloneError(interruptsResource);
|
||||
CloneError(m_interrupts);
|
||||
return;
|
||||
}
|
||||
m_interruptIndex = index;
|
||||
|
||||
Reference in New Issue
Block a user