Skip to content

Commit 991c7ee

Browse files
committed
Cleanup
1 parent 0b8a22c commit 991c7ee

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/Button.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,16 @@
2525
* Debounced Input Pin template class using GPIO. The internal pullup
2626
* resistor is used. The button/switch should be connected to ground.
2727
* @param[in] PIN board pin for input signal.
28+
* @param[in] DEBOUNCE time limit (Default 50 ms).
2829
*/
29-
template<BOARD::pin_t PIN>
30+
template<BOARD::pin_t PIN, uint16_t DEBOUNCE = 50>
3031
class Button {
3132
public:
3233
/**
3334
* Construct debounced input pin instance with given template
3435
* parameters. Initiate GPIO pins input mode with pullup resistor.
35-
* @param[in] ms debounce time limit (Default 50 ms).
3636
*/
37-
Button(uint16_t ms = 50) :
38-
DEBOUNCE(ms),
37+
Button() :
3938
m_timestamp(0),
4039
m_state(true)
4140
{
@@ -89,9 +88,6 @@ class Button {
8988
return (m_timestamp);
9089
}
9190

92-
/** Debounce time in milli-seconds. */
93-
const uint16_t DEBOUNCE;
94-
9591
protected:
9692
/** Button pin. */
9793
GPIO<PIN> m_pin;

0 commit comments

Comments
 (0)