Closed BlackEdder closed 6 years ago
Yes. I should have implemented it to begin with. Never used non-static Tasks - somehow never needed one. But with more powerful MCs with lots of memory - let's do this properly.
Will test and merge.
Added to the "testing" branch. Will merge with "master" once thoroughly tested with all the existing examples and prior code. Also need to create a specific test case/example where tasks are actually deleted.
Fixed in testing branch. Would you please test/confirm?
@arkhipenko I have been trying to get this to compile, but keep getting errors about double definitions. It is like it is trying to include the same header file twice. Have you had any problems getting the _TASK_STD_FUNCTION examples to compile?
Also it might be good to enable std function support on the ESP32 board as well, currently it can only be enabled on ESP8266.
Another good addition would be to define
#define TASK_MILLISECOND ...
similar to TASK_SECOND etc.
I could only compile STD_FUNCTIONS on ESP8266 board. Any other board - BOOM. The new typedefs are not compiling consistently either: could you have a look at #28?
This ensures that a task is deleted from the scheduler when its destructor gets called, i.e. it goes out of scope.