Closed BlackEdder closed 6 years ago
You need to do it as described in this example: https://github.com/arkhipenko/TaskScheduler/tree/master/examples/Scheduler_example16_Multitab
Thanks @arkhipenko We have now solved this by including "TaskSchedulerDeclarations.h" header in most files, not the "TaskScheduler.h".
Check the new release I just pushed into testing branch:
https://github.com/arkhipenko/TaskScheduler/tree/testing/examples/Scheduler_example21_OO_Callbacks
This version 3.0.0 support dynamic callback method binding via compilation parameter _TASK_OO_CALLBACKS
In essence, you create each type of task as a separate class, inherited from the Task class, overload Callback(), OnEnable() and OnDisable() methods (latter 2 optionally), and have full access to your task context without having to deal with LTS.
Cheers, Anatoli
From: Edwin van Leeuwen notifications@github.com Sent: Thursday, March 8, 2018 6:44 AM To: arkhipenko/TaskScheduler Cc: Anatoli Arkhipenko; Mention Subject: Re: [arkhipenko/TaskScheduler] Multiple definition error when including taskscheduler (from a separate header file.) (#51)
Closed #51https://github.com/arkhipenko/TaskScheduler/issues/51.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/arkhipenko/TaskScheduler/issues/51#event-1510961050, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AATGTXOq-iMA0znQsnXLk4yZ-d4DY7CAks5tcRmogaJpZM4SbAC4.
I tried setting up a simple project (using platformio) and get the following compilation error (I am pretty sure this used to work without a problem.)
While debuggin this I found that it happens even with just four files:
src/foo.h
src/foo.cpp
src/main.ino
platformio.ini