TickerScheduler icon indicating copy to clipboard operation
TickerScheduler copied to clipboard

Is it possible to call a function with arguments?

Open pfabri opened this issue 8 years ago • 4 comments

In other words, must the callback function f be of the form f(void) or can it have arguments?

Many thanks for your help, neat library!

pfabri avatar Dec 27 '16 17:12 pfabri

For now there is no support for callback parameters. But it is in my TODO list :)

Toshik avatar Jan 04 '17 15:01 Toshik

If std library can be used it would be possible. Bind() function is your friend. I do not know it it is possible with Arduino, with esp8266 it is. Look at this code https://gist.github.com/gmag11/bd3f845c3eba2543df04d6de93f0474f It is not exactly what you need but maybe you get what I mean.

gmag11 avatar Jan 04 '17 15:01 gmag11

Thanks for this really neat & useful library, one thing though I noticed it has a little typo that causes a compile time error. typedef std::function<void(void)> tscallback_t; should be typedef std::function<void(void*)> tscallback_t;

missing * on the param part.

janmir avatar Mar 06 '17 11:03 janmir

@janmir thanks for notice e945e55190e3aee905cb1e8484687d1092877301 fix

Toshik avatar Mar 12 '17 07:03 Toshik