Skip to content

Commit

Permalink
Merge pull request #121 from IhorNehrutsa/Fix_deprecated_messages
Browse files Browse the repository at this point in the history
Fix deprecated messages.
  • Loading branch information
mathertel committed May 10, 2023
2 parents daf844f + bfb715c commit e509af5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/OneButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,24 @@ OneButton::OneButton(const int pin, const boolean activeLow, const bool pullupAc


// explicitly set the number of millisec that have to pass by before a click is assumed stable.
void OneButton::setDebounceTicks(const unsigned int ms)
void OneButton::setDebounceMs(const unsigned int ms)
{
_debounce_ms = ms;
} // setDebounceTicks
} // setDebounceMs


// explicitly set the number of millisec that have to pass by before a click is detected.
void OneButton::setClickTicks(const unsigned int ms)
void OneButton::setClickMs(const unsigned int ms)
{
_click_ms = ms;
} // setClickTicks
} // setClickMs


// explicitly set the number of millisec that have to pass by before a long button press is detected.
void OneButton::setPressTicks(const unsigned int ms)
void OneButton::setPressMs(const unsigned int ms)
{
_press_ms = ms;
} // setPressTicks
} // setPressMs


// save function for click event
Expand Down
12 changes: 6 additions & 6 deletions src/OneButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ class OneButton
* set # millisec after safe click is assumed.
*/
[[deprecated("Use setDebounceMs() instead.")]]
void setDebounceTicks(const unsigned int ms); // deprecated
void setDebounceMs(const unsigned int ms) { setDebounceTicks(ms); };
void setDebounceTicks(const unsigned int ms) { setDebounceMs(ms); }; // deprecated
void setDebounceMs(const unsigned int ms);

/**
* set # millisec after single click is assumed.
*/
[[deprecated("Use setClickMs() instead.")]]
void setClickTicks(const unsigned int ms); // deprecated
void setClickMs(const unsigned int ms) { setClickTicks(ms); };
void setClickTicks(const unsigned int ms) { setClickMs(ms); }; // deprecated
void setClickMs(const unsigned int ms);

/**
* set # millisec after press is assumed.
*/
[[deprecated("Use setPressMs() instead.")]]
void setPressTicks(const unsigned int ms); // deprecated
void setPressMs(const unsigned int ms) { setPressTicks(ms); };
void setPressTicks(const unsigned int ms) { setPressMs(ms); }; // deprecated
void setPressMs(const unsigned int ms);

// ----- Attach events functions -----

Expand Down

0 comments on commit e509af5

Please sign in to comment.