diff --git a/firmware/controllers/system/timer/scheduler.h b/firmware/controllers/system/timer/scheduler.h index f730a52229..a3c02b5bca 100644 --- a/firmware/controllers/system/timer/scheduler.h +++ b/firmware/controllers/system/timer/scheduler.h @@ -83,7 +83,6 @@ struct ExecutorInterface { /** * see also scheduleByAngle */ - 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 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 2f7aac187a..7b44fd6b6e 100644 --- a/firmware/controllers/system/timer/single_timer_executor.cpp +++ b/firmware/controllers/system/timer/single_timer_executor.cpp @@ -45,20 +45,6 @@ SingleTimerExecutor::SingleTimerExecutor() { } -/** - * @brief Schedule an event at specific delay after now - * - * Invokes event callback after the specified amount of time. - * callback would be executed either on ISR thread or current thread if we would need to execute right away - * - * @param [in, out] scheduling Data structure to keep this event in the collection. - * @param [in] delayUs the number of microseconds before the output signal immediate output if delay is zero. - * @param [in] dwell the number of ticks of output duration. - */ -void SingleTimerExecutor::scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) { - scheduleByTimestampNt(msg, scheduling, efitick_t{US2NT(timeUs)}, action); -} - void SingleTimerExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* scheduling, efitick_t nt, action_s action) { ScopePerf perf(PE::SingleTimerExecutorScheduleByTimestamp); diff --git a/firmware/controllers/system/timer/single_timer_executor.h b/firmware/controllers/system/timer/single_timer_executor.h index 06b23d0595..7fc5d60997 100644 --- a/firmware/controllers/system/timer/single_timer_executor.h +++ b/firmware/controllers/system/timer/single_timer_executor.h @@ -13,7 +13,6 @@ class SingleTimerExecutor final : public ExecutorInterface { 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 cancel(scheduling_s* scheduling) override; diff --git a/simulator/simulator/system/signal_executor_sleep.cpp b/simulator/simulator/system/signal_executor_sleep.cpp index 03defe476c..05f0e1203e 100644 --- a/simulator/simulator/system/signal_executor_sleep.cpp +++ b/simulator/simulator/system/signal_executor_sleep.cpp @@ -37,12 +37,8 @@ struct CallbackContext 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) { - scheduleByTimestamp(msg, scheduling, NT2US(timeNt), action); + doScheduleForLater(scheduling, NT2US(timeNt) - getTimeNowUs(), action); } static void timerCallback(CallbackContext* ctx) { diff --git a/simulator/simulator/system/signal_executor_sleep.h b/simulator/simulator/system/signal_executor_sleep.h index 5cb2e04454..e82812ba3d 100644 --- a/simulator/simulator/system/signal_executor_sleep.h +++ b/simulator/simulator/system/signal_executor_sleep.h @@ -11,7 +11,6 @@ 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 cancel(scheduling_s* s) override; }; diff --git a/unit_tests/global_execution_queue.cpp b/unit_tests/global_execution_queue.cpp index c9b721782e..d69feb28d1 100644 --- a/unit_tests/global_execution_queue.cpp +++ b/unit_tests/global_execution_queue.cpp @@ -35,26 +35,13 @@ scheduling_s* TestExecutor::getForUnitTest(int index) { return schedulingQueue.getElementAtIndexForUnitText(index); } -void TestExecutor::scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) { - if (debugSignalExecutor) { - printf("scheduleByTime %d\r\n", timeUs); - } - - if (m_mockExecutor) { - m_mockExecutor->scheduleByTimestamp(msg, scheduling, timeUs, action); - return; - } - - schedulingQueue.insertTask(scheduling, timeUs, action); -} - void TestExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* scheduling, efitick_t timeNt, action_s action) { if (m_mockExecutor) { m_mockExecutor->scheduleByTimestampNt(msg, scheduling, timeNt, action); return; } - scheduleByTimestamp(msg, scheduling, NT2US(timeNt), action); + schedulingQueue.insertTask(scheduling, NT2US(timeNt), action); } void TestExecutor::cancel(scheduling_s* s) { diff --git a/unit_tests/global_execution_queue.h b/unit_tests/global_execution_queue.h index 40e0d6341e..a4c70b4c27 100644 --- a/unit_tests/global_execution_queue.h +++ b/unit_tests/global_execution_queue.h @@ -14,7 +14,6 @@ class TestExecutor : public ExecutorInterface { public: ~TestExecutor(); - 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 cancel(scheduling_s* scheduling) override; diff --git a/unit_tests/mocks.h b/unit_tests/mocks.h index c14fe370b7..e3bba1886a 100644 --- a/unit_tests/mocks.h +++ b/unit_tests/mocks.h @@ -79,7 +79,6 @@ public: MockExecutor(); virtual ~MockExecutor(); - 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, cancel, (scheduling_s*), (override)); };