From 6b361db68d8e4298d7ce6b4dd8cd3da579ffd2c3 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Thu, 5 Apr 2012 21:43:12 -0400 Subject: [PATCH] Removed _lastTime private variable, was not used. --- Button.cpp | 3 --- Button.h | 1 - 2 files changed, 4 deletions(-) diff --git a/Button.cpp b/Button.cpp index b998f22..3b78045 100644 --- a/Button.cpp +++ b/Button.cpp @@ -43,7 +43,6 @@ Button::Button(uint8_t pin, uint8_t puEnable, uint8_t invert, uint32_t dbTime) _time = millis(); _lastState = _state; _changed = 0; - _lastTime = _time; _lastChange = _time; } @@ -60,13 +59,11 @@ uint8_t Button::read(void) pinVal = digitalRead(_pin); if (_invert != 0) pinVal = !pinVal; if (ms - _lastChange < _dbTime) { - _lastTime = _time; _time = ms; _changed = 0; return _state; } else { - _lastTime = _time; _lastState = _state; _state = pinVal; _time = ms; diff --git a/Button.h b/Button.h index 0eb8687..33704bb 100644 --- a/Button.h +++ b/Button.h @@ -36,7 +36,6 @@ class Button uint8_t _lastState; //previous button state uint8_t _changed; //state changed since last read uint32_t _time; //time of current state (all times are in ms) - uint32_t _lastTime; //time of previous state uint32_t _lastChange; //time of last state change uint32_t _dbTime; //debounce time };