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.21k stars 221 forks source link

Declare task to run with delay #165

Closed vatsake closed 1 year ago

vatsake commented 1 year ago

Currently if I enable a task, it runs immediately. Can you enable it with delay? Without calling <task>.enableDelayed();

arkhipenko commented 1 year ago

Hi, That's what task.enableDelayed() is there for. Why can't you use it?

You can also do:

task.enable(); task.delay() or task.delay(time);

this is actually what enableDelayed() is doing.


From: vatsake @.> Sent: Friday, April 28, 2023 7:16 AM To: arkhipenko/TaskScheduler @.> Cc: Subscribed @.***> Subject: [arkhipenko/TaskScheduler] Declare task to run with delay (Issue #165)

Currently if I enable a task, it runs immediately. Can you enable it with delay? Without calling .enableDelayed();

— Reply to this email directly, view it on GitHubhttps://github.com/arkhipenko/TaskScheduler/issues/165, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AACMMTKVDLMO6BZIIVWZTS3XDORHFANCNFSM6AAAAAAXPDBNGM. You are receiving this because you are subscribed to this thread.Message ID: @.***>

vatsake commented 1 year ago

I can sure sure, but that's an extra line :) Would've been nice if it was in the constructor.