arkhipenko / TaskScheduler

Cooperative multitasking for Arduino, ESPx, STM32, nRF and other microcontrollers
http://playground.arduino.cc/Code/TaskScheduler
BSD 3-Clause "New" or "Revised" License
1.26k stars 230 forks source link

No Task default contructor if _TASK_STATUS_REQUEST #68

Closed vadimostanin closed 5 years ago

vadimostanin commented 5 years ago

I defined _TASK_STATUS_REQUEST, then I can't create empty Task object, because there is two constructors that are satisfy conditions with empty arguments: INLINE Task(unsigned long aInterval=0, long aIterations=0, TaskCallback aCallback=NULL, Scheduler* aScheduler=NULL, bool aEnable=false, TaskOnEnable aOnEnable=NULL, TaskOnDisable aOnDisable=NULL);

ifdef _TASK_STATUS_REQUEST

INLINE Task(TaskCallback aCallback=NULL, Scheduler* aScheduler=NULL, TaskOnEnable aOnEnable=NULL, TaskOnDisable aOnDisable=NULL);
arkhipenko commented 5 years ago

Yes, it's a known problem - I just don't have time to fix it. Workaround: do not use default Task t; constructor. Use something like Task t(&callback, &scheduler);

vadimostanin commented 5 years ago

Yes, seems acceptable workarounds exists. I will close issue.