mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[robotpy] Mirror most other subprojects (#8208)
GitOrigin-RevId: ac60fd3cf4a24023184376687da28373d14b781a This mirrors the robotpy files for the following projects: - apriltag - datalog - hal - ntcore - romiVendordep - wpilibc - wpimath - xrpVendordep This excludes cscore and the halsim wrappers for at this time. NOTE: This does not hook these projects up to the build system, just simply mirrors the files. The building will take place in a follow up PR to make it easier to review the changes necessary to build.
This commit is contained in:
29
hal/src/main/python/hal/simulation/resethandles.cpp
Normal file
29
hal/src/main/python/hal/simulation/resethandles.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
#ifndef __FRC_SYSTEMCORE__
|
||||
#include <hal/Notifier.h>
|
||||
#include <hal/handles/HandlesInternal.h>
|
||||
#include <hal/simulation/NotifierData.h>
|
||||
|
||||
void HALSIM_ResetGlobalHandles() {
|
||||
|
||||
// if we just reset the handles, notifiers might hang forever,
|
||||
// so we just enumerate and cancel them all
|
||||
auto sz = HALSIM_GetNotifierInfo(nullptr, 0);
|
||||
if (sz > 0) {
|
||||
struct HALSIM_NotifierInfo *info = new struct HALSIM_NotifierInfo[sz];
|
||||
HALSIM_GetNotifierInfo(info, sz);
|
||||
|
||||
for (int i = 0; i < sz; i++) {
|
||||
HAL_CleanNotifier(info->handle);
|
||||
}
|
||||
}
|
||||
|
||||
hal::HandleBase::ResetGlobalHandles();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void HALSIM_ResetGlobalHandles() {}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user