From db8bf3a21323f69c8cb433c516db1c2d32391e41 Mon Sep 17 00:00:00 2001 From: JChristensen Date: Mon, 14 May 2018 08:14:36 -0400 Subject: [PATCH] Fix constructor initializer list order. Closes #14. --- library.properties | 2 +- src/JC_Button.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library.properties b/library.properties index 46ab07f..5e418e8 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=JC_Button -version=2.0.0 +version=2.0.1 author=Jack Christensen maintainer=Jack Christensen sentence=Arduino library to debounce button switches, detect presses, releases, and long presses. diff --git a/src/JC_Button.h b/src/JC_Button.h index 1934a6d..f079e6c 100644 --- a/src/JC_Button.h +++ b/src/JC_Button.h @@ -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 @@ -61,6 +61,7 @@ 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 @@ -68,6 +69,5 @@ class Button 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