diff --git a/firmware/controllers/system/timer/scheduler.h b/firmware/controllers/system/timer/scheduler.h index caef678b95..f730a52229 100644 --- a/firmware/controllers/system/timer/scheduler.h +++ b/firmware/controllers/system/timer/scheduler.h @@ -85,7 +85,6 @@ struct ExecutorInterface { */ virtual void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) = 0; virtual void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) = 0; - virtual void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) = 0; virtual void cancel(scheduling_s* scheduling) = 0; }; diff --git a/firmware/controllers/system/timer/single_timer_executor.cpp b/firmware/controllers/system/timer/single_timer_executor.cpp index adb39f7efa..2f7aac187a 100644 --- a/firmware/controllers/system/timer/single_timer_executor.cpp +++ b/firmware/controllers/system/timer/single_timer_executor.cpp @@ -45,10 +45,6 @@ SingleTimerExecutor::SingleTimerExecutor() { } -void SingleTimerExecutor::scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) { - scheduleByTimestamp(msg, scheduling, getTimeNowUs() + delayUs, action); -} - /** * @brief Schedule an event at specific delay after now * diff --git a/firmware/controllers/system/timer/single_timer_executor.h b/firmware/controllers/system/timer/single_timer_executor.h index a82e18bb2b..06b23d0595 100644 --- a/firmware/controllers/system/timer/single_timer_executor.h +++ b/firmware/controllers/system/timer/single_timer_executor.h @@ -15,7 +15,6 @@ public: SingleTimerExecutor(); void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override; void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override; - void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override; void cancel(scheduling_s* scheduling) override; void onTimerCallback(); diff --git a/simulator/simulator/system/signal_executor_sleep.cpp b/simulator/simulator/system/signal_executor_sleep.cpp index f9911e57da..03defe476c 100644 --- a/simulator/simulator/system/signal_executor_sleep.cpp +++ b/simulator/simulator/system/signal_executor_sleep.cpp @@ -35,8 +35,10 @@ struct CallbackContext bool shouldFree = false; }; -void SleepExecutor::scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) { - scheduleForLater(msg, scheduling, timeUs - getTimeNowUs(), action); +static void doScheduleForLater(scheduling_s *scheduling, int delayUs, action_s action); + +void SleepExecutor::scheduleByTimestamp(const char* /*msg*/, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) { + doScheduleForLater(scheduling, timeUs - getTimeNowUs(), action); } void SleepExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* scheduling, efitick_t timeNt, action_s action) { @@ -90,10 +92,6 @@ static void doScheduleForLater(scheduling_s *scheduling, int delayUs, action_s a chVTSetI(&scheduling->timer, delaySt, (vtfunc_t)timerCallback, ctx); } -void SleepExecutor::scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) { - doScheduleForLater(scheduling, delayUs, action); -} - void SleepExecutor::cancel(scheduling_s* s) { chibios_rt::CriticalSectionLocker csl; diff --git a/simulator/simulator/system/signal_executor_sleep.h b/simulator/simulator/system/signal_executor_sleep.h index 095c71626e..5cb2e04454 100644 --- a/simulator/simulator/system/signal_executor_sleep.h +++ b/simulator/simulator/system/signal_executor_sleep.h @@ -13,6 +13,5 @@ class SleepExecutor : public ExecutorInterface { public: void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override; void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override; - void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override; void cancel(scheduling_s* s) override; }; diff --git a/unit_tests/global_execution_queue.cpp b/unit_tests/global_execution_queue.cpp index dd3787a81a..c9b721782e 100644 --- a/unit_tests/global_execution_queue.cpp +++ b/unit_tests/global_execution_queue.cpp @@ -15,19 +15,6 @@ TestExecutor::~TestExecutor() { clear(); } -void TestExecutor::scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) { - if (debugSignalExecutor) { - printf("scheduleTask %d\r\n", delayUs); - } - - if (m_mockExecutor) { - m_mockExecutor->scheduleForLater(msg, scheduling, delayUs, action); - return; - } - - scheduleByTimestamp(msg, scheduling, getTimeNowUs() + delayUs, action); -} - int TestExecutor::executeAll(efitick_t now) { return schedulingQueue.executeAll(now); } diff --git a/unit_tests/global_execution_queue.h b/unit_tests/global_execution_queue.h index 7962fcea9b..40e0d6341e 100644 --- a/unit_tests/global_execution_queue.h +++ b/unit_tests/global_execution_queue.h @@ -16,7 +16,6 @@ public: void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override; void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override; - void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override; void cancel(scheduling_s* scheduling) override; void clear(); diff --git a/unit_tests/mocks.h b/unit_tests/mocks.h index 4c2c925411..c14fe370b7 100644 --- a/unit_tests/mocks.h +++ b/unit_tests/mocks.h @@ -81,7 +81,6 @@ public: MOCK_METHOD(void, scheduleByTimestamp, (const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action), (override)); MOCK_METHOD(void, scheduleByTimestampNt, (const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action), (override)); - MOCK_METHOD(void, scheduleForLater, (const char *msg, scheduling_s *scheduling, int delayUs, action_s action), (override)); MOCK_METHOD(void, cancel, (scheduling_s*), (override)); };