Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/Bounce.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

/*
* Check Bounce2.h for licensing / authors.
*/

#include "Bounce2.h"


/*
* Bounce
*/

Bounce::Bounce()
: pin(0) {}


void Bounce::attach(int pin){

this -> pin = pin;

// Set Initial State

begin();
}


void Bounce::attach(int pin,int mode){

setPinMode(pin,mode);

this -> attach(pin);
}
155 changes: 0 additions & 155 deletions src/Bounce2.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions src/Bounce2.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,15 @@ class Debouncer

// Note : this is private as it migh change in the futur
private:
inline void updateTime();
inline void changeState();
inline void setStateFlag(const uint8_t flag) {state |= flag;}
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) const {return((state & flag) != 0);}
inline bool thresholdPassed() const;
inline bool isDebouncing(const bool state) const;
inline bool isUnstable(const bool state) const;

public:
/*!
Expand Down
Loading