Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow MAX_SEQUENCES to be overriden on build #68

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions src/EasyButtonBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void EasyButtonBase::onPressedFor(uint32_t duration, EasyButtonBase::callback_t
#ifndef EASYBUTTON_DO_NOT_USE_SEQUENCES
void EasyButtonBase::onSequence(uint8_t sequences, uint32_t duration, EasyButtonBase::callback_t callback)
{
if (_sequences_count < 5)
if (_sequences_count < MAX_SEQUENCES)
{
Sequence sequence(sequences, duration);
sequence.enable();
Expand Down Expand Up @@ -85,4 +85,4 @@ void EasyButtonBase::_checkPressedTime()
_pressed_for_callback();
}
}
}
}
5 changes: 5 additions & 0 deletions src/EasyButtonBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
#endif

#ifndef EASYBUTTON_DO_NOT_USE_SEQUENCES
#ifndef EASYBUTTON_MAX_SEQUENCES
#define MAX_SEQUENCES 5
#else
#define MAX_SEQUENCES 4 // EASYBUTTON_MAX_SEQUENCES
#warning MAX_SEQUENCES
#endif
#endif

class EasyButtonBase
Expand Down