Closed EvsanDlg closed 3 years ago
You are very welcome to make enhancements and propose a pull request. We’d be happy to review and merge.
Thanks!
Ohh, forgot to answer the thread.. I have poor skills in C++. I tried just to change typedef-s like in forked SimpleTimer but it doesn't help. Obviously, some deeper changes needed with BlynkTimer. It would be great if your team or someone managed this. Thanks!
It is unable now to use setTimeout or any other blynk timer functions with lambdas like this:
Getting an error:
"no matching function for call to 'BlynkTimer::setTimeout(long int, setup()::__lambda0)'"
This issue was also disscussed at blynk community forum
Supposedly, BlynkTimer does not support lambda (as far as the way it should be), because it is a fork of Marcello Romani’s Simple timer, that neither does. But there is another fork on github, where the support of lambdas stated as a feature.
Some changes with timer_callback (timer_callback_p) typedefs and style of calling passed functions needed.
As a result of fix, supporting std::function or lambda-expressions known from C++11 will get an ability to pass local vars to lambda, and thanks to it use deffered actions with fixed values in lambda-manner