Closed IhorNehrutsa closed 1 year ago
yes, this one was missing.
Now code is duplicated in debounce(const int value)
and tick()
.
You can call debounce() in tick() so it seems.
Please add some documentation that tick()
is debouncing by itself but tick(bool activeLevel)
is not.
This will be a major release as the interface is changing.
Backward compatibility is saved at that moment. Old code will work with
void setDebounceTicks(const unsigned int ms); // obsolete
void setClickTicks(const unsigned int ms); // obsolete
void setPressTicks(const unsigned int ms); // obsolete
and future code will work with
void setDebounceMs(const unsigned int ms);
void setClickMs(const unsigned int ms);
void setPressMs(const unsigned int ms);
Both
void tick(void);
void tick(bool level);
perform debouncing itself.
Thank you Matthias for the fast review. Comments are welcome.