mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +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
|
||||
|
||||
Reference in New Issue
Block a user