Skip to content

Commit

Permalink
Merge pull request #38 from umeshwalkar/master
Browse files Browse the repository at this point in the history
Updated preprocessor macros INTERRUPT and POLL to avoid conflicts
  • Loading branch information
Evert Arias committed Apr 3, 2020
2 parents c4b7ff0 + ebee876 commit 5496efd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/EasyButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool EasyButton::read(int read_type)
// since button released, reset _pressed_for_callbackCalled value.
_held_callback_called = false;
}
else if(isPressed() && read_type == POLL)
else if(isPressed() && read_type == EASYBUTTON_TYPE_POLL)
_checkPressedTime();


Expand Down
6 changes: 3 additions & 3 deletions src/EasyButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include "FunctionalInterrupt.h"
#endif

#define INTERRUPT 0
#define POLL 1
#define EASYBUTTON_TYPE_INTERRUPT 0
#define EASYBUTTON_TYPE_POLL 1

#define MAX_SEQUENCES 5

Expand All @@ -38,7 +38,7 @@ class EasyButton
~EasyButton() {}
// PUBLIC FUNCTIONS
virtual void begin(); // Initialize a button object and the pin it's connected to.
bool read(int read_type = POLL); // Returns the current debounced button state, true for pressed, false for released.
bool read(int read_type = EASYBUTTON_TYPE_POLL); // Returns the current debounced button state, true for pressed, false for released.
void update(); // Update button pressed time, only needed when using interrupts
void onPressed(callback_t callback); // Call a callback function when the button has been pressed and released.
void onPressedFor(uint32_t duration, callback_t callback); // Call a callback function when the button has been held for at least the given number of milliseconds.
Expand Down

0 comments on commit 5496efd

Please sign in to comment.