10#include "frc/DriverStation.h"
11#include "frc/Notifier.h"
12#include "hal/simulation/MockHooks.h"
24 return *autoFeedEnable;
29 frc::Notifier _enableNotifier;
30 uint32_t _startCount = 0;
34 if (frc::DriverStation::IsEnabled()) {
46 std::lock_guard<std::mutex> lock{_lck};
47 if (_startCount < UINT32_MAX) {
48 if (_startCount++ == 0) {
50 _enableNotifier.StartPeriodic(20_ms);
62 std::lock_guard<std::mutex> lock{_lck};
63 if (_startCount > 0) {
64 if (--_startCount == 0) {
66 _enableNotifier.Stop();
Definition: AutoFeedEnable.hpp:19
void Start()
Starts feeding the enable signal to CTRE actuators.
Definition: AutoFeedEnable.hpp:44
static AutoFeedEnable & GetInstance()
Definition: AutoFeedEnable.hpp:21
void Stop()
Stops feeding the enable signal to CTRE actuators.
Definition: AutoFeedEnable.hpp:60
CTREXPORT void FeedEnable(int timeoutMs)
Feed the robot enable.
Definition: string_util.hpp:15