Made the bounce2 library const correct

This commit is contained in:
Dan Neve
2021-03-04 19:14:11 +01:00
parent e89801c2dd
commit a132f4ab43
2 changed files with 21 additions and 21 deletions
+5 -5
View File
@@ -100,11 +100,11 @@ bool Debouncer::update()
}
// WIP HELD
unsigned long Debouncer::previousDuration() {
unsigned long Debouncer::previousDuration() const {
return durationOfPreviousState;
}
unsigned long Debouncer::duration() {
unsigned long Debouncer::duration() const {
return (millis() - stateChangeLastTime);
}
@@ -115,17 +115,17 @@ inline void Debouncer::changeState() {
stateChangeLastTime = millis();
}
bool Debouncer::read()
bool Debouncer::read() const
{
return getStateFlag(DEBOUNCED_STATE);
}
bool Debouncer::rose()
bool Debouncer::rose() const
{
return getStateFlag(DEBOUNCED_STATE) && getStateFlag(CHANGED_STATE);
}
bool Debouncer::fell()
bool Debouncer::fell() const
{
return !getStateFlag(DEBOUNCED_STATE) && getStateFlag(CHANGED_STATE);
}