Fixes interrupts not getting closed properly. (#1088)

The threads being created were never getting cleaned up.
This commit is contained in:
Thad House
2018-05-24 17:02:13 -07:00
committed by Peter Johnson
parent 62d5301b1f
commit 381c25c573
4 changed files with 43 additions and 17 deletions

View File

@@ -105,10 +105,15 @@ HAL_InterruptHandle HAL_InitializeInterrupts(HAL_Bool watcher,
return handle;
}
void HAL_CleanInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status) {
void* HAL_CleanInterrupts(HAL_InterruptHandle interruptHandle,
int32_t* status) {
HAL_DisableInterrupts(interruptHandle, status);
auto interrupt = interruptHandles->Get(interruptHandle);
auto anInterrupt = interruptHandles->Get(interruptHandle);
interruptHandles->Free(interruptHandle);
if (anInterrupt == nullptr) {
return nullptr;
}
return anInterrupt->callbackParam;
}
static void ProcessInterruptDigitalSynchronous(const char* name, void* param,