evert-arias / EasyButton

Arduino library for debouncing momentary contact switches, detect press, release, long press and sequences with event definitions and callbacks.
https://easybtn.earias.me
MIT License
447 stars 62 forks source link

Allow MAX_SEQUENCES to be overriden on build #68

Open nuxeh opened 2 years ago

nuxeh commented 2 years ago

Love the lib :)

This is useful to not consume unnecessary SRAM when only requiring, e.g. a single sequence, giving the possibility of saving a fair amount of resources in such cases.

In my testing, on Arduino UNO, setting EASYBUTTON_MAX_SEQUENCES to 1 saves 64 bytes.

nuxeh commented 2 years ago

Actually, this causes warnings about redefinition of the class (and doesn't work at all) when EASYBUTTON_MAX_SEQUENCES is anything other than 5, which is currently baffling me.