10#include "frc/DriverStation.h"
11#include "frc/Notifier.h"
23 return *autoFeedEnable;
28 frc::Notifier _enableNotifier;
29 uint32_t _startCount = 0;
33 if (frc::DriverStation::IsEnabled()) {
45 std::lock_guard<std::mutex> lock{_lck};
46 if (_startCount < UINT32_MAX) {
47 if (_startCount++ == 0) {
49 _enableNotifier.StartPeriodic(20_ms);
61 std::lock_guard<std::mutex> lock{_lck};
62 if (_startCount > 0) {
63 if (--_startCount == 0) {
65 _enableNotifier.Stop();
Definition: AutoFeedEnable.hpp:18
void Start()
Starts feeding the enable signal to CTRE actuators.
Definition: AutoFeedEnable.hpp:43
static AutoFeedEnable & GetInstance()
Definition: AutoFeedEnable.hpp:20
void Stop()
Stops feeding the enable signal to CTRE actuators.
Definition: AutoFeedEnable.hpp:59
CTREXPORT void FeedEnable(int timeoutMs)
Feed the robot enable.
Represents the state of one swerve module.
Definition: StatusCodes.h:18