Moves Interrupts over to Handles instead of pointers (#99)

This commit is contained in:
Thad House
2016-06-20 23:22:49 -07:00
committed by Peter Johnson
parent 74fc10999b
commit 046e043c4e
10 changed files with 180 additions and 148 deletions

View File

@@ -29,12 +29,11 @@ AnalogTriggerOutput::AnalogTriggerOutput(const AnalogTrigger& trigger,
}
AnalogTriggerOutput::~AnalogTriggerOutput() {
if (m_interrupt != nullptr) {
if (m_interrupt != HAL_INVALID_HANDLE) {
int32_t status = 0;
cleanInterrupts(m_interrupt, &status);
wpi_setErrorWithContext(status, getHALErrorMessage(status));
m_interrupt = nullptr;
m_interrupts->Free(m_interruptIndex);
// ignore status, as an invalid handle just needs to be ignored.
m_interrupt = HAL_INVALID_HANDLE;
}
}