Sming - Open Source framework for high efficiency native ESP8266 development

User avatar
By helpme
#27066 For a timer function without parameters, it can be called this way;

Code: Select allprocTimer.initializeMs(2000, sayHello).start();


What if the timer function has arguments like sayHello(int x, char* y)? How do I call procTimer.initializeMs() to handle timer function with arguments?
User avatar
By hreintke
#27102 LS,
Currently there is no possibility to have a timer callback with parameters.
However you can have "Class function callbacks", as opposed to "Static callbacks".
That mostly prevents the necessity for parameters in the callback.

There is a discussion started on Sming Gihub (https://github.com/anakod/Sming) on an enhancement request to add the parameter as you asked for. Not finalized and decision on that yet.