mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpilib] Rename EdgeConfiguration constants to all caps
This commit is contained in:
@@ -19,7 +19,7 @@ Tachometer::Tachometer(int channel, EdgeConfiguration configuration)
|
||||
int32_t status = 0;
|
||||
std::string stackTrace = wpi::util::GetStackTrace(1);
|
||||
m_handle = HAL_InitializeCounter(
|
||||
channel, configuration == EdgeConfiguration::kRisingEdge,
|
||||
channel, configuration == EdgeConfiguration::RISING_EDGE,
|
||||
stackTrace.c_str(), &status);
|
||||
WPILIB_CheckErrorStatus(status, "{}", channel);
|
||||
|
||||
@@ -29,7 +29,7 @@ Tachometer::Tachometer(int channel, EdgeConfiguration configuration)
|
||||
|
||||
void Tachometer::SetEdgeConfiguration(EdgeConfiguration configuration) {
|
||||
int32_t status = 0;
|
||||
bool rising = configuration == EdgeConfiguration::kRisingEdge;
|
||||
bool rising = configuration == EdgeConfiguration::RISING_EDGE;
|
||||
HAL_SetCounterEdgeConfiguration(m_handle, rising, &status);
|
||||
WPILIB_CheckErrorStatus(status, "{}", m_channel);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ UpDownCounter::UpDownCounter(int channel, EdgeConfiguration configuration)
|
||||
int32_t status = 0;
|
||||
std::string stackTrace = wpi::util::GetStackTrace(1);
|
||||
m_handle = HAL_InitializeCounter(
|
||||
channel, configuration == EdgeConfiguration::kRisingEdge,
|
||||
channel, configuration == EdgeConfiguration::RISING_EDGE,
|
||||
stackTrace.c_str(), &status);
|
||||
WPILIB_CheckErrorStatus(status, "{}", channel);
|
||||
|
||||
@@ -44,7 +44,7 @@ void UpDownCounter::Reset() {
|
||||
|
||||
void UpDownCounter::SetEdgeConfiguration(EdgeConfiguration configuration) {
|
||||
int32_t status = 0;
|
||||
bool rising = configuration == EdgeConfiguration::kRisingEdge;
|
||||
bool rising = configuration == EdgeConfiguration::RISING_EDGE;
|
||||
HAL_SetCounterEdgeConfiguration(m_handle, rising, &status);
|
||||
WPILIB_CheckErrorStatus(status, "{}", m_channel);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace wpi {
|
||||
*/
|
||||
enum class EdgeConfiguration {
|
||||
/// Rising edge configuration.
|
||||
kRisingEdge = 0,
|
||||
RISING_EDGE = 0,
|
||||
/// Falling edge configuration.
|
||||
kFallingEdge = 1,
|
||||
FALLING_EDGE = 1,
|
||||
};
|
||||
} // namespace wpi
|
||||
|
||||
@@ -7,9 +7,9 @@ package org.wpilib.counter;
|
||||
/** Edge configuration. */
|
||||
public enum EdgeConfiguration {
|
||||
/** Rising edge configuration. */
|
||||
kRisingEdge(true),
|
||||
RISING_EDGE(true),
|
||||
/** Falling edge configuration. */
|
||||
kFallingEdge(false);
|
||||
FALLING_EDGE(false);
|
||||
|
||||
/** True if triggering on rising edge. */
|
||||
@SuppressWarnings("MemberName")
|
||||
|
||||
Reference in New Issue
Block a user