Skip to content

Commit 069f9b2

Browse files
committed
removed warning
1 parent dec6b41 commit 069f9b2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/EZButton.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void EZButton::Loop()
7171
unsigned long stateChangeDiff = millis() - _buttonDownMillis[i];
7272
if (stateChangeDiff < DebounceTime)
7373
continue;
74-
74+
7575
if (buttonStates[i])
7676
{
7777
if (!_buttonLastState[i])
@@ -114,11 +114,16 @@ void EZButton::Subscribe(int index, Event event, EventTypes type)
114114
LogEvent("Subscribe:", index, type);
115115
}
116116

117+
void EZButton::Subscribe(int index, void (*event)(), EventTypes type)
118+
{
119+
Subscribe(index, (Event)event, type);
120+
}
121+
117122
void EZButton::CallEvent(int index, EventTypes type)
118123
{
119124
int i = EventIndex(index, type);
120125

121-
LogEvent("Call:",index, type);
126+
LogEvent("Call:", index, type);
122127

123128
if (_events[i] != nullptr)
124129
_events[i](index);

src/EZButton.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class EZButton
3232
void Blackout(unsigned long milis);
3333
void Loop();
3434
void Subscribe(int index, Event event, EventTypes type);
35+
void Subscribe(int index, void (*event)(), EventTypes type);
3536

3637
private:
3738
int _numButtons;

0 commit comments

Comments
 (0)