diff --git a/src/shared/scheduler/TaskScheduler.cpp b/src/shared/scheduler/TaskScheduler.cpp index b92b9a642068a71972f74fcae85364d438a2fabe..c236dcc5dd5967bdda89ccb31e2fb8d86391619a 100644 --- a/src/shared/scheduler/TaskScheduler.cpp +++ b/src/shared/scheduler/TaskScheduler.cpp @@ -87,26 +87,6 @@ size_t TaskScheduler::addTask(function_t function, uint32_t period, return id; } -bool TaskScheduler::removeTask(size_t id) -{ - Lock<FastMutex> lock(mutex); - - // Check if the task is actually present - if ((*tasks)[id].valid == false) - { - // Unlock the mutex for expensive operation - Unlock<FastMutex> unlock(mutex); - - LOG_ERR(logger, "Attempting to remove a task not registered"); - return false; - } - - // Set the validity of the task to false - (*tasks)[id].valid = false; - - return true; -} - bool TaskScheduler::start() { // This check is necessary to prevent task normalization if the scheduler is diff --git a/src/shared/scheduler/TaskScheduler.h b/src/shared/scheduler/TaskScheduler.h index cca4627971d1917972e67e65fd3e948e8adec84a..0130a6dee19950536a4cd86e8475d882bdae25e8 100644 --- a/src/shared/scheduler/TaskScheduler.h +++ b/src/shared/scheduler/TaskScheduler.h @@ -119,14 +119,6 @@ public: Policy policy = Policy::SKIP, int64_t startTick = miosix::getTick()); - /** - * @brief Removes the task identified by the given id if it exists. - * - * @param id Id of the task to remove. - * @return true if the task was removed. - */ - bool removeTask(size_t id); - bool start() override; void stop() override; diff --git a/src/tests/scheduler/test-taskscheduler.cpp b/src/tests/scheduler/test-taskscheduler.cpp index b7501d468bde77c20d5f86f0371a5340854e2a1d..1ac40adbd241aa0733b73f77cb30ab4c50d36e2f 100644 --- a/src/tests/scheduler/test-taskscheduler.cpp +++ b/src/tests/scheduler/test-taskscheduler.cpp @@ -112,8 +112,6 @@ int main() Thread::sleep(4 * 1000); signalPin5(); - scheduler.removeTask(1); - scheduler.removeTask(3); printf("Removed tasks 1 (2Hz) and 3 (500Hz)\n"); Thread::sleep(4 * 1000);