Added a protected changed() function

This commit is contained in:
Thomas O Fredericks
2019-10-05 16:14:33 -04:00
parent 3e4738b4ef
commit 01e6fc9398
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ bool Bounce::update()
#endif
return getStateFlag(CHANGED_STATE);
return changed();
}
+4
View File
@@ -194,6 +194,10 @@ class Bounce
inline void unsetStateFlag(const uint8_t flag) {state &= ~flag;}
inline void toggleStateFlag(const uint8_t flag) {state ^= flag;}
inline bool getStateFlag(const uint8_t flag) {return((state & flag) != 0);}
protected:
bool Bounce::changed( ) { return getStateFlag(CHANGED_STATE); }
};
#endif