From 91a6e946b6aaa21df14b084f47f6886587526077 Mon Sep 17 00:00:00 2001 From: Christian Iversen Date: Sat, 11 Oct 2014 18:17:43 +0200 Subject: [PATCH 1/2] * Renamed BOUNCE_LOCK-OUT to BOUNCE_LOCK_OUT. Only the latter is a valid preprocessor define --- Bounce2/Bounce2.cpp | 4 ++-- Bounce2/Bounce2.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Bounce2/Bounce2.cpp b/Bounce2/Bounce2.cpp index 3f15364..7f40970 100644 --- a/Bounce2/Bounce2.cpp +++ b/Bounce2/Bounce2.cpp @@ -27,7 +27,7 @@ void Bounce::attach(int pin) { if (digitalRead(pin)) { state = _BV(DEBOUNCED_STATE) | _BV(UNSTABLE_STATE); } - #ifdef BOUNCE_LOCK-OUT + #ifdef BOUNCE_LOCK_OUT previous_millis = 0; #else previous_millis = millis(); @@ -41,7 +41,7 @@ void Bounce::interval(uint16_t interval_millis) bool Bounce::update() { -#ifdef BOUNCE_LOCK-OUT +#ifdef BOUNCE_LOCK_OUT state &= ~_BV(STATE_CHANGED); // Ignore everything if we are locked out if (millis() - previous_millis >= interval_millis) { diff --git a/Bounce2/Bounce2.h b/Bounce2/Bounce2.h index 59b5f13..2032650 100644 --- a/Bounce2/Bounce2.h +++ b/Bounce2/Bounce2.h @@ -30,7 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // Uncomment the following line for "LOCK-OUT" debounce method -//#define BOUNCE_LOCK-OUT +//#define BOUNCE_LOCK_OUT #ifndef Bounce2_h -- 2.54.0 From ee2f46fb87dd31df16d7f9360b2aefbee20ec57a Mon Sep 17 00:00:00 2001 From: Christian Iversen Date: Sat, 11 Oct 2014 18:21:59 +0200 Subject: [PATCH 2/2] + Added safeguard against old invalid define --- Bounce2/Bounce2.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Bounce2/Bounce2.h b/Bounce2/Bounce2.h index 2032650..df9402c 100644 --- a/Bounce2/Bounce2.h +++ b/Bounce2/Bounce2.h @@ -29,6 +29,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Previous contributions by Eric Lowry, Jim Schimpf and Tom Harkaway * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifdef BOUNCE_LOCK +#error You are using the invalid BOUNCE_LOCK-OUT define. Please update your sources to use BOUNCE_LOCK_OUT +#endif + // Uncomment the following line for "LOCK-OUT" debounce method //#define BOUNCE_LOCK_OUT -- 2.54.0