mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilibc] Add mechanism to reset MotorSafety list (#4037)
This commit is contained in:
@@ -17,6 +17,15 @@ using namespace frc;
|
||||
static wpi::SmallPtrSet<MotorSafety*, 32> instanceList;
|
||||
static wpi::mutex listMutex;
|
||||
|
||||
#ifndef __FRC_ROBORIO__
|
||||
namespace frc::impl {
|
||||
void ResetMotorSafety() {
|
||||
std::scoped_lock lock(listMutex);
|
||||
instanceList.clear();
|
||||
}
|
||||
} // namespace frc::impl
|
||||
#endif
|
||||
|
||||
MotorSafety::MotorSafety() {
|
||||
std::scoped_lock lock(listMutex);
|
||||
instanceList.insert(this);
|
||||
|
||||
Reference in New Issue
Block a user