Skip to content
Snippets Groups Projects
Commit a88c89f3 authored by Matteo Pignataro's avatar Matteo Pignataro Committed by Niccolò Betto
Browse files

[TaskScheduler] Fixed pipeline

parent 8639cd28
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ uint8_t TaskScheduler::addTask(function_t function, uint32_t period,
uint8_t id = 1;
// Find a suitable id for the new task
for (; tasks[id] != nullptr && id < 255; ++id)
for (; id < 255 && tasks[id] != nullptr; ++id)
;
return addTask(function, period, id, policy, startTick);
......
......@@ -80,7 +80,7 @@ int main()
// Start a periodic task to move the first three servos
TaskScheduler scheduler;
uint8_t id = scheduler.addTask(&moveServo, 2 * 1000);
scheduler.addTask(&moveServo, 2 * 1000);
scheduler.start();
// Control the fourth servo manually
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment