Correct names of button library

pull/14/head
Dennis Bücker 1 year ago
parent 5c0bb83212
commit 2ca345af38
  1. 4
      src/utility/Button.cpp
  2. 4
      src/utility/Button.h

@ -106,7 +106,7 @@ uint8_t Button::wasReleased(void) {
return !_state && _changed && millis() - _pressTime < _hold_time;
}
uint8_t Button::wasReleasefor(uint32_t ms) {
uint8_t Button::wasReleaseFor(uint32_t ms) {
_hold_time = ms;
return !_state && _changed && millis() - _pressTime >= ms;
}
@ -116,7 +116,7 @@ uint8_t Button::wasReleasefor(uint32_t ms) {
* time in milliseconds. Returns false (0) or true (1) accordingly. *
* These functions do not cause the button to be read. *
*----------------------------------------------------------------------*/
uint8_t Button::pressedFor(uint32_t ms) {
uint8_t Button::wasPressedFor(uint32_t ms) {
return (_state == 1 && _time - _lastChange >= ms) ? 1 : 0;
}

@ -23,9 +23,9 @@ class Button {
uint8_t isReleased();
uint8_t wasPressed();
uint8_t wasReleased();
uint8_t pressedFor(uint32_t ms);
uint8_t wasPressedFor(uint32_t ms);
uint8_t releasedFor(uint32_t ms);
uint8_t wasReleasefor(uint32_t ms);
uint8_t wasReleaseFor(uint32_t ms);
uint32_t lastChange();
private:

Loading…
Cancel
Save