[wpilib] Rename EdgeConfiguration constants to all caps

This commit is contained in:
Peter Johnson
2026-03-17 16:37:56 -07:00
parent 5ec92df137
commit 8fa6976cb2
4 changed files with 8 additions and 8 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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

View File

@@ -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")