Skip to content

Commit

Permalink
Fix constructor initializer list order. Closes #14.
Browse files Browse the repository at this point in the history
  • Loading branch information
JChristensen committed May 14, 2018
1 parent 277501e commit db8bf3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=JC_Button
version=2.0.0
version=2.0.1
author=Jack Christensen <[email protected]>
maintainer=Jack Christensen <[email protected]>
sentence=Arduino library to debounce button switches, detect presses, releases, and long presses.
Expand Down
4 changes: 2 additions & 2 deletions src/JC_Button.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Button
// dbTime Debounce time in milliseconds (default 25ms)
// puEnable true to enable the AVR internal pullup resistor (default true)
// invert true to interpret a low logic level as pressed (default true)
Button::Button(uint8_t pin, uint32_t dbTime=25, uint8_t puEnable=true, uint8_t invert=true)
Button(uint8_t pin, uint32_t dbTime=25, uint8_t puEnable=true, uint8_t invert=true)
: m_pin(pin), m_dbTime(dbTime), m_puEnable(puEnable), m_invert(invert) {}

// Initialize a Button object and the pin it's connected to
Expand Down Expand Up @@ -61,13 +61,13 @@ class Button

private:
uint8_t m_pin; // arduino pin number connected to button
uint32_t m_dbTime; // debounce time (ms)
bool m_puEnable; // internal pullup resistor enabled
bool m_invert; // if true, interpret logic low as pressed, else interpret logic high as pressed
bool m_state; // current button state, true=pressed
bool m_lastState; // previous button state
bool m_changed; // state changed since last read
uint32_t m_time; // time of current state (ms from millis)
uint32_t m_lastChange; // time of last state change (ms)
uint32_t m_dbTime; // debounce time (ms)
};
#endif

0 comments on commit db8bf3a

Please sign in to comment.