remove scheduleByTimestamp()

This commit is contained in:
Matthew Kennedy 2024-07-11 16:38:42 -07:00
parent 89a0b273c6
commit e61e4c4b09
8 changed files with 2 additions and 38 deletions

View File

@ -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;
};

View File

@ -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);

View File

@ -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;

View File

@ -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) {

View File

@ -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;
};

View File

@ -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) {

View File

@ -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;

View File

@ -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));
};