mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Switch away from NI interrupt manager to custom implementation (#3705)
* Switch away from NI interrupt manager to custom implementation * Formatting * Fix tidy * Formatting * Fix loading * Make interrupt api public * Add multiple wait api * Formatting * Fix build * Fix review comments * wpiformat Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@@ -351,6 +351,26 @@ int64_t HAL_WaitForInterrupt(HAL_InterruptHandle interruptHandle,
|
||||
}
|
||||
}
|
||||
|
||||
int64_t HAL_WaitForMultipleInterrupts(HAL_InterruptHandle interruptHandle,
|
||||
int64_t mask, double timeout,
|
||||
HAL_Bool ignorePrevious,
|
||||
int32_t* status) {
|
||||
// TODO make this properly work, will require a decent rewrite
|
||||
auto interrupt = interruptHandles->Get(interruptHandle);
|
||||
if (interrupt == nullptr) {
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return WaitResult::Timeout;
|
||||
}
|
||||
|
||||
if (interrupt->isAnalog) {
|
||||
return WaitForInterruptAnalog(interruptHandle, interrupt.get(), timeout,
|
||||
ignorePrevious);
|
||||
} else {
|
||||
return WaitForInterruptDigital(interruptHandle, interrupt.get(), timeout,
|
||||
ignorePrevious);
|
||||
}
|
||||
}
|
||||
|
||||
int64_t HAL_ReadInterruptRisingTimestamp(HAL_InterruptHandle interruptHandle,
|
||||
int32_t* status) {
|
||||
auto interrupt = interruptHandles->Get(interruptHandle);
|
||||
|
||||
Reference in New Issue
Block a user