File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 25
25
* Debounced Input Pin template class using GPIO. The internal pullup
26
26
* resistor is used. The button/switch should be connected to ground.
27
27
* @param[in] PIN board pin for input signal.
28
+ * @param[in] DEBOUNCE time limit (Default 50 ms).
28
29
*/
29
- template <BOARD::pin_t PIN>
30
+ template <BOARD::pin_t PIN, uint16_t DEBOUNCE = 50 >
30
31
class Button {
31
32
public:
32
33
/* *
33
34
* Construct debounced input pin instance with given template
34
35
* parameters. Initiate GPIO pins input mode with pullup resistor.
35
- * @param[in] ms debounce time limit (Default 50 ms).
36
36
*/
37
- Button (uint16_t ms = 50 ) :
38
- DEBOUNCE (ms),
37
+ Button () :
39
38
m_timestamp (0 ),
40
39
m_state (true )
41
40
{
@@ -89,9 +88,6 @@ class Button {
89
88
return (m_timestamp);
90
89
}
91
90
92
- /* * Debounce time in milli-seconds. */
93
- const uint16_t DEBOUNCE;
94
-
95
91
protected:
96
92
/* * Button pin. */
97
93
GPIO<PIN> m_pin;
You can’t perform that action at this time.
0 commit comments