mirror of https://github.com/FOME-Tech/fome-fw.git
remove scheduleByTimestamp()
This commit is contained in:
parent
89a0b273c6
commit
e61e4c4b09
|
@ -83,7 +83,6 @@ struct ExecutorInterface {
|
||||||
/**
|
/**
|
||||||
* see also scheduleByAngle
|
* 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 scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) = 0;
|
||||||
virtual void cancel(scheduling_s* scheduling) = 0;
|
virtual void cancel(scheduling_s* scheduling) = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -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) {
|
void SingleTimerExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* scheduling, efitick_t nt, action_s action) {
|
||||||
ScopePerf perf(PE::SingleTimerExecutorScheduleByTimestamp);
|
ScopePerf perf(PE::SingleTimerExecutorScheduleByTimestamp);
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
class SingleTimerExecutor final : public ExecutorInterface {
|
class SingleTimerExecutor final : public ExecutorInterface {
|
||||||
public:
|
public:
|
||||||
SingleTimerExecutor();
|
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 scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override;
|
||||||
void cancel(scheduling_s* scheduling) override;
|
void cancel(scheduling_s* scheduling) override;
|
||||||
|
|
||||||
|
|
|
@ -37,12 +37,8 @@ struct CallbackContext
|
||||||
|
|
||||||
static void doScheduleForLater(scheduling_s *scheduling, int delayUs, action_s 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) {
|
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) {
|
static void timerCallback(CallbackContext* ctx) {
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
class SleepExecutor : public ExecutorInterface {
|
class SleepExecutor : public ExecutorInterface {
|
||||||
public:
|
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 scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override;
|
||||||
void cancel(scheduling_s* s) override;
|
void cancel(scheduling_s* s) override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,26 +35,13 @@ scheduling_s* TestExecutor::getForUnitTest(int index) {
|
||||||
return schedulingQueue.getElementAtIndexForUnitText(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) {
|
void TestExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* scheduling, efitick_t timeNt, action_s action) {
|
||||||
if (m_mockExecutor) {
|
if (m_mockExecutor) {
|
||||||
m_mockExecutor->scheduleByTimestampNt(msg, scheduling, timeNt, action);
|
m_mockExecutor->scheduleByTimestampNt(msg, scheduling, timeNt, action);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduleByTimestamp(msg, scheduling, NT2US(timeNt), action);
|
schedulingQueue.insertTask(scheduling, NT2US(timeNt), action);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestExecutor::cancel(scheduling_s* s) {
|
void TestExecutor::cancel(scheduling_s* s) {
|
||||||
|
|
|
@ -14,7 +14,6 @@ class TestExecutor : public ExecutorInterface {
|
||||||
public:
|
public:
|
||||||
~TestExecutor();
|
~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 scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override;
|
||||||
void cancel(scheduling_s* scheduling) override;
|
void cancel(scheduling_s* scheduling) override;
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,6 @@ public:
|
||||||
MockExecutor();
|
MockExecutor();
|
||||||
virtual ~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, scheduleByTimestampNt, (const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action), (override));
|
||||||
MOCK_METHOD(void, cancel, (scheduling_s*), (override));
|
MOCK_METHOD(void, cancel, (scheduling_s*), (override));
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue