CTRE Phoenix C++
5.35.1
Loading...
Searching...
No Matches
WPI_AutoFeedEnable.h
Go to the documentation of this file.
1
/* Copyright (C) Cross The Road Electronics 2024 */
2
#pragma once
3
4
#include "frc/DriverStation.h"
5
#include "
ctre/phoenix/unmanaged/Unmanaged.h
"
6
#include "hal/simulation/MockHooks.h"
7
8
namespace
ctre
{
9
namespace
phoenix {
10
namespace
motorcontrol {
11
class
WPI_AutoFeedEnable
{
12
public
:
13
static
WPI_AutoFeedEnable
&
GetInstance
() {
14
static
WPI_AutoFeedEnable
* autoFeedEnable =
new
WPI_AutoFeedEnable
();
15
return
*autoFeedEnable;
16
}
17
18
private
:
19
WPI_AutoFeedEnable
() {
20
HALSIM_RegisterSimPeriodicBeforeCallback(OnPeriodic,
this
);
21
}
22
23
static
void
OnPeriodic(
void
* param) {
24
if
(frc::DriverStation::IsEnabled()) {
25
unmanaged::Unmanaged::FeedEnable
(100);
26
}
27
}
28
};
29
}
30
}
31
}
Unmanaged.h
ctre::phoenix::motorcontrol::WPI_AutoFeedEnable
Definition
WPI_AutoFeedEnable.h:11
ctre::phoenix::motorcontrol::WPI_AutoFeedEnable::GetInstance
static WPI_AutoFeedEnable & GetInstance()
Definition
WPI_AutoFeedEnable.h:13
ctre::phoenix::unmanaged::Unmanaged::FeedEnable
static void FeedEnable(int timeoutMs)
Feed the enable frame.
ctre
WPI Compliant CANcoder class.
Definition
CANCoderStatusFrame.h:4
ctre
phoenix
motorcontrol
WPI_AutoFeedEnable.h
Generated by
1.12.0