Replaced const variables with constexpr (#731)

This commit is contained in:
Tyler Veness
2017-11-19 19:04:28 -08:00
committed by Peter Johnson
parent 259461aee9
commit 5af0c9c101
16 changed files with 26 additions and 59 deletions

View File

@@ -32,9 +32,7 @@ struct MatchInfoData {
using namespace frc;
const double JOYSTICK_UNPLUGGED_MESSAGE_INTERVAL = 1.0;
const int DriverStation::kJoystickPorts;
static constexpr double kJoystickUnpluggedMessageInterval = 1.0;
DriverStation::~DriverStation() {
m_isRunning = false;
@@ -721,7 +719,7 @@ void DriverStation::ReportJoystickUnpluggedError(llvm::StringRef message) {
double currentTime = Timer::GetFPGATimestamp();
if (currentTime > m_nextMessageTime) {
ReportError(message);
m_nextMessageTime = currentTime + JOYSTICK_UNPLUGGED_MESSAGE_INTERVAL;
m_nextMessageTime = currentTime + kJoystickUnpluggedMessageInterval;
}
}
@@ -734,7 +732,7 @@ void DriverStation::ReportJoystickUnpluggedWarning(llvm::StringRef message) {
double currentTime = Timer::GetFPGATimestamp();
if (currentTime > m_nextMessageTime) {
ReportWarning(message);
m_nextMessageTime = currentTime + JOYSTICK_UNPLUGGED_MESSAGE_INTERVAL;
m_nextMessageTime = currentTime + kJoystickUnpluggedMessageInterval;
}
}