dead code, reduce typedefs (#4566)
* Do lightweight checks first
* Dead getTimeIgnitionSeconds()
Dead since 81fffe87b7
* Get rid of efitime_t.
Purpose are not clear. Use efitick_t where ticks are used,
use efitimeus_t for uS, use efitimems_t or efitimems64_t for mS.
* Fix unit tests
* Fix misc: stm32f1_test_project
This commit is contained in:
parent
e2addd1951
commit
55c1f53c75
|
@ -451,7 +451,7 @@ void Engine::efiWatchdog() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (engine->configBurnTimer.hasElapsedSec(5) && engineConfiguration->tempBooleanForVerySpecialLogic) {
|
||||
if (engineConfiguration->tempBooleanForVerySpecialLogic && engine->configBurnTimer.hasElapsedSec(5)) {
|
||||
static efitimems_t mostRecentMs = 0;
|
||||
|
||||
efitimems_t msNow = getTimeNowMs();
|
||||
|
@ -575,15 +575,6 @@ bool Engine::isMainRelayEnabled() const {
|
|||
#endif /* EFI_MAIN_RELAY_CONTROL */
|
||||
}
|
||||
|
||||
|
||||
float Engine::getTimeIgnitionSeconds(void) const {
|
||||
// return negative if the ignition is turned off
|
||||
if (ignitionOnTimeNt == 0)
|
||||
return -1;
|
||||
float numSeconds = (float)NT2US(getTimeNowNt() - ignitionOnTimeNt) / US_PER_SECOND_F;
|
||||
return numSeconds;
|
||||
}
|
||||
|
||||
injection_mode_e getCurrentInjectionMode() {
|
||||
return getEngineRotationState()->isCranking() ? engineConfiguration->crankingInjectionMode : engineConfiguration->injectionMode;
|
||||
}
|
||||
|
|
|
@ -280,7 +280,7 @@ public:
|
|||
int startStopStateToggleCounter = 0;
|
||||
|
||||
/**
|
||||
* this is needed by getTimeIgnitionSeconds() and checkShutdown()
|
||||
* this is needed by and checkShutdown()
|
||||
* todo: refactor to Timer?
|
||||
*/
|
||||
efitick_t ignitionOnTimeNt = 0;
|
||||
|
@ -378,13 +378,6 @@ public:
|
|||
*/
|
||||
bool isMainRelayEnabled() const;
|
||||
|
||||
/**
|
||||
* Needed by EFI_MAIN_RELAY_CONTROL to handle fuel pump and shutdown timings correctly.
|
||||
* This method returns the number of seconds since the ignition voltage is present.
|
||||
* The return value is float for more FSIO flexibility.
|
||||
*/
|
||||
float getTimeIgnitionSeconds(void) const;
|
||||
|
||||
void onSparkFireKnockSense(uint8_t cylinderIndex, efitick_t nowNt);
|
||||
|
||||
#if EFI_UNIT_TEST
|
||||
|
|
|
@ -41,14 +41,6 @@ using time_t = uint32_t;
|
|||
// time in seconds
|
||||
using efitimesec_t = time_t;
|
||||
|
||||
/**
|
||||
* integer time in milliseconds (1/1_000 of a second)
|
||||
* 32 bit 4B / 1000 = 4M seconds = 1111.11 hours = 23(or46?) days.
|
||||
* Please restart your ECU every 23(or46?) days? :) See issue https://github.com/rusefi/rusefi/issues/4554 tag#4554
|
||||
* See getTimeNowUs()
|
||||
*/
|
||||
using efitimems_t = uint32_t;
|
||||
|
||||
/**
|
||||
* We use a signed type here so that subtraction result is a proper negative value.
|
||||
* A typical use-case negative result is when we do 'timeNow() - timeOfEvent' where timeOfEvent
|
||||
|
@ -58,24 +50,30 @@ using efitimems_t = uint32_t;
|
|||
* See US2NT
|
||||
* See MS2US
|
||||
*/
|
||||
using efitime_t = int64_t;
|
||||
|
||||
/**
|
||||
* platform-dependent tick since boot
|
||||
* in case of stm32f4 that's 32-bit timer ticks (SCHEDULER_TIMER_DEVICE == TIM5) extended to 64 bits
|
||||
*/
|
||||
using efitick_t = int64_t;
|
||||
|
||||
/**
|
||||
* 64 bit time in microseconds (1/1_000_000 of a second), since boot
|
||||
*/
|
||||
using efitimeus_t = efitime_t;
|
||||
using efitimeus_t = int64_t;
|
||||
|
||||
/**
|
||||
* 64 bit time in milliseconds (1/1_000 of a second), since boot
|
||||
*/
|
||||
using efitimems64_t = efitime_t;
|
||||
|
||||
using efitimems64_t = int64_t;
|
||||
|
||||
/**
|
||||
* platform-dependent tick since boot
|
||||
* in case of stm32f4 that's a CPU tick
|
||||
* integer time in milliseconds (1/1_000 of a second)
|
||||
* 32 bit 4B / 1000 = 4M seconds = 1111.11 hours = 23(or46?) days.
|
||||
* Please restart your ECU every 23(or46?) days? :) See issue https://github.com/rusefi/rusefi/issues/4554 tag#4554
|
||||
* See getTimeNowUs()
|
||||
*/
|
||||
using efitick_t = efitime_t;
|
||||
using efitimems_t = uint32_t;
|
||||
|
||||
using angle_t = float;
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ void registerCanSensor(CanSensorBase& sensor);
|
|||
class CanWrite final : public PeriodicController<512> {
|
||||
public:
|
||||
CanWrite();
|
||||
void PeriodicTask(efitime_t nowNt) override;
|
||||
void PeriodicTask(efitick_t nowNt) override;
|
||||
};
|
||||
|
||||
// allow using shorthand CI
|
||||
|
|
|
@ -25,7 +25,7 @@ CanWrite::CanWrite()
|
|||
{
|
||||
}
|
||||
|
||||
void CanWrite::PeriodicTask(efitime_t nowNt) {
|
||||
void CanWrite::PeriodicTask(efitick_t nowNt) {
|
||||
UNUSED(nowNt);
|
||||
static uint16_t cycleCount = 0;
|
||||
CanCycle cycle(cycleCount);
|
||||
|
|
|
@ -376,7 +376,7 @@ efitick_t scheduleByAngle(scheduling_s *timer, efitick_t edgeTimestamp, angle_t
|
|||
|
||||
// 'delayNt' is below 10 seconds here so we use 32 bit type for performance reasons
|
||||
int32_t delayNt = USF2NT(delayUs);
|
||||
efitime_t delayedTime = edgeTimestamp + delayNt;
|
||||
efitick_t delayedTime = edgeTimestamp + delayNt;
|
||||
|
||||
engine->executor.scheduleByTimestampNt("angle", timer, delayedTime, action);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ extern bool verboseMode;
|
|||
/**
|
||||
* @return true if inserted into the head of the list
|
||||
*/
|
||||
bool EventQueue::insertTask(scheduling_s *scheduling, efitime_t timeX, action_s action) {
|
||||
bool EventQueue::insertTask(scheduling_s *scheduling, efitick_t timeX, action_s action) {
|
||||
ScopePerf perf(PE::EventQueueInsertTask);
|
||||
|
||||
#if EFI_UNIT_TEST
|
||||
|
@ -128,7 +128,7 @@ void EventQueue::remove(scheduling_s* scheduling) {
|
|||
* This method is always invoked under a lock
|
||||
* @return Get the timestamp of the soonest pending action, skipping all the actions in the past
|
||||
*/
|
||||
expected<efitime_t> EventQueue::getNextEventTime(efitime_t nowX) const {
|
||||
expected<efitick_t> EventQueue::getNextEventTime(efitick_t nowX) const {
|
||||
if (head != NULL) {
|
||||
if (head->momentX <= nowX) {
|
||||
/**
|
||||
|
@ -157,7 +157,7 @@ uint32_t maxEventCallbackDuration = 0;
|
|||
* Invoke all pending actions prior to specified timestamp
|
||||
* @return number of executed actions
|
||||
*/
|
||||
int EventQueue::executeAll(efitime_t now) {
|
||||
int EventQueue::executeAll(efitick_t now) {
|
||||
ScopePerf perf(PE::EventQueueExecuteAll);
|
||||
|
||||
int executionCounter = 0;
|
||||
|
@ -175,7 +175,7 @@ int EventQueue::executeAll(efitime_t now) {
|
|||
return executionCounter;
|
||||
}
|
||||
|
||||
bool EventQueue::executeOne(efitime_t now) {
|
||||
bool EventQueue::executeOne(efitick_t now) {
|
||||
// Read the head every time - a previously executed event could
|
||||
// have inserted something new at the head
|
||||
scheduling_s* current = head;
|
||||
|
|
|
@ -44,18 +44,18 @@ public:
|
|||
// See comment in EventQueue::executeAll for info about lateDelay - it sets the
|
||||
// time gap between events for which we will wait instead of rescheduling the next
|
||||
// event in a group of events near one another.
|
||||
EventQueue(efitime_t lateDelay = 0) : lateDelay(lateDelay) {}
|
||||
EventQueue(efitick_t lateDelay = 0) : lateDelay(lateDelay) {}
|
||||
|
||||
/**
|
||||
* O(size) - linear search in sorted linked list
|
||||
*/
|
||||
bool insertTask(scheduling_s *scheduling, efitime_t timeX, action_s action);
|
||||
bool insertTask(scheduling_s *scheduling, efitick_t timeX, action_s action);
|
||||
void remove(scheduling_s* scheduling);
|
||||
|
||||
int executeAll(efitime_t now);
|
||||
bool executeOne(efitime_t now);
|
||||
int executeAll(efitick_t now);
|
||||
bool executeOne(efitick_t now);
|
||||
|
||||
expected<efitime_t> getNextEventTime(efitime_t nowUs) const;
|
||||
expected<efitick_t> getNextEventTime(efitick_t nowUs) const;
|
||||
void clear(void);
|
||||
int size(void) const;
|
||||
scheduling_s *getElementAtIndexForUnitText(int index);
|
||||
|
@ -66,6 +66,6 @@ private:
|
|||
* this list is sorted
|
||||
*/
|
||||
scheduling_s *head = nullptr;
|
||||
const efitime_t lateDelay;
|
||||
const efitick_t lateDelay;
|
||||
};
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ struct scheduling_s {
|
|||
/**
|
||||
* timestamp represented as 64-bit value of ticks since MCU start
|
||||
*/
|
||||
volatile efitime_t momentX = 0;
|
||||
volatile efitick_t momentX = 0;
|
||||
|
||||
/**
|
||||
* Scheduler implementation uses a sorted linked list of these scheduling records.
|
||||
|
@ -63,7 +63,7 @@ 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, efitime_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;
|
||||
};
|
||||
|
|
|
@ -63,7 +63,7 @@ void SingleTimerExecutor::scheduleByTimestamp(const char *msg, scheduling_s *sch
|
|||
scheduleByTimestampNt(msg, scheduling, US2NT(timeUs), action);
|
||||
}
|
||||
|
||||
void SingleTimerExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* scheduling, efitime_t nt, action_s action) {
|
||||
void SingleTimerExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* scheduling, efitick_t nt, action_s action) {
|
||||
ScopePerf perf(PE::SingleTimerExecutorScheduleByTimestamp);
|
||||
|
||||
#if EFI_ENABLE_ASSERTS
|
||||
|
|
|
@ -14,7 +14,7 @@ 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, efitime_t timeNt, 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;
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
*/
|
||||
void incrementShaftSynchronizationCounter();
|
||||
|
||||
efitime_t getTotalEventCounter() const;
|
||||
int64_t getTotalEventCounter() const;
|
||||
|
||||
expected<TriggerDecodeResult> decodeTriggerEvent(
|
||||
const char *msg,
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
TriggerStateListener* triggerStateListener,
|
||||
const TriggerConfiguration& triggerConfiguration,
|
||||
const trigger_event_e signal,
|
||||
const efitime_t nowUs);
|
||||
const efitick_t nowNt);
|
||||
|
||||
void onShaftSynchronization(
|
||||
bool wasSynchronized,
|
||||
|
|
|
@ -170,7 +170,7 @@ static float getSignalOnTime(int index) {
|
|||
return reader.last_wave_high_widthUs / 1000.0f;
|
||||
}
|
||||
|
||||
static efitime_t getWaveOffset(int index) {
|
||||
static efitimeus_t getWaveOffset(int index) {
|
||||
return readers[index].waveOffsetUs;
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ static void reportWave(Logging *logging, int index) {
|
|||
logging->appendFloat(periodMs, 2);
|
||||
logging->appendPrintf("%s", LOG_DELIMITER);
|
||||
|
||||
uint32_t offsetUs = getWaveOffset(index);
|
||||
efitimeus_t offsetUs = getWaveOffset(index);
|
||||
int rpm = Sensor::getOrZero(SensorType::Rpm);
|
||||
if (rpm != 0) {
|
||||
float oneDegreeUs = getOneDegreeTimeUs(rpm);
|
||||
|
|
|
@ -369,7 +369,7 @@ void TriggerAdcDetector::analogCallback(efitick_t stamp, triggerAdcSample_t valu
|
|||
integralSum = 0;
|
||||
#if 0
|
||||
// update triggerAdcITerm
|
||||
efitime_t deltaTimeUs = NT2US(stamp - prevStamp);
|
||||
efitimeus_t deltaTimeUs = NT2US(stamp - prevStamp);
|
||||
if (deltaTimeUs > 200) { // 200 us = ~2500 RPM (we don't need this correction for large RPM)
|
||||
triggerAdcITerm = 1.0f / (triggerAdcITermCoef * deltaTimeUs);
|
||||
triggerAdcITerm = maxF(triggerAdcITerm, triggerAdcITermMin);
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
#define US2MS(US_TIME) ((US_TIME) / 1000)
|
||||
|
||||
// microseconds to ticks
|
||||
// since only about 20 seconds of ticks fit in 32 bits this macro is casting parameter into 64 bits 'efitime_t' type
|
||||
// since only about 20 seconds of ticks fit in 32 bits this macro is casting parameter into 64 bits 'efitick_t' type
|
||||
// please note that int64 <-> float is a heavy operation thus we have 'USF2NT' below
|
||||
#define US2NT(us) (((efitime_t)(us)) * US_TO_NT_MULTIPLIER)
|
||||
#define US2NT(us) (((efitick_t)(us)) * US_TO_NT_MULTIPLIER)
|
||||
|
||||
// microseconds to ticks, but floating point
|
||||
// If converting a floating point time period, use this macro to avoid
|
||||
|
|
|
@ -26,7 +26,7 @@ extern bool verboseMode;
|
|||
/**
|
||||
* @return true if inserted into the head of the list
|
||||
*/
|
||||
bool EventQueue::insertTask(scheduling_s *scheduling, efitime_t timeX, action_s action) {
|
||||
bool EventQueue::insertTask(scheduling_s *scheduling, efitick_t timeX, action_s action) {
|
||||
ScopePerf perf(PE::EventQueueInsertTask);
|
||||
|
||||
#if EFI_UNIT_TEST
|
||||
|
@ -129,7 +129,7 @@ void EventQueue::remove(scheduling_s* scheduling) {
|
|||
* This method is always invoked under a lock
|
||||
* @return Get the timestamp of the soonest pending action, skipping all the actions in the past
|
||||
*/
|
||||
expected<efitime_t> EventQueue::getNextEventTime(efitime_t nowX) const {
|
||||
expected<efitick_t> EventQueue::getNextEventTime(efitick_t nowX) const {
|
||||
if (head != NULL) {
|
||||
if (head->momentX <= nowX) {
|
||||
/**
|
||||
|
@ -158,7 +158,7 @@ uint32_t maxEventCallbackDuration = 0;
|
|||
* Invoke all pending actions prior to specified timestamp
|
||||
* @return number of executed actions
|
||||
*/
|
||||
int EventQueue::executeAll(efitime_t now) {
|
||||
int EventQueue::executeAll(efitick_t now) {
|
||||
ScopePerf perf(PE::EventQueueExecuteAll);
|
||||
|
||||
int executionCounter = 0;
|
||||
|
@ -176,7 +176,7 @@ int EventQueue::executeAll(efitime_t now) {
|
|||
return executionCounter;
|
||||
}
|
||||
|
||||
bool EventQueue::executeOne(efitime_t now) {
|
||||
bool EventQueue::executeOne(efitick_t now) {
|
||||
// Read the head every time - a previously executed event could
|
||||
// have inserted something new at the head
|
||||
scheduling_s* current = head;
|
||||
|
|
|
@ -44,18 +44,18 @@ public:
|
|||
// See comment in EventQueue::executeAll for info about lateDelay - it sets the
|
||||
// time gap between events for which we will wait instead of rescheduling the next
|
||||
// event in a group of events near one another.
|
||||
EventQueue(efitime_t lateDelay = 0) : lateDelay(lateDelay) {}
|
||||
EventQueue(efitick_t lateDelay = 0) : lateDelay(lateDelay) {}
|
||||
|
||||
/**
|
||||
* O(size) - linear search in sorted linked list
|
||||
*/
|
||||
bool insertTask(scheduling_s *scheduling, efitime_t timeX, action_s action);
|
||||
bool insertTask(scheduling_s *scheduling, efitick_t timeX, action_s action);
|
||||
void remove(scheduling_s* scheduling);
|
||||
|
||||
int executeAll(efitime_t now);
|
||||
bool executeOne(efitime_t now);
|
||||
int executeAll(efitick_t now);
|
||||
bool executeOne(v now);
|
||||
|
||||
expected<efitime_t> getNextEventTime(efitime_t nowUs) const;
|
||||
expected<efitick_t> getNextEventTime(efitick_t nowX) const;
|
||||
void clear(void);
|
||||
int size(void) const;
|
||||
scheduling_s *getElementAtIndexForUnitText(int index);
|
||||
|
@ -66,6 +66,6 @@ private:
|
|||
* this list is sorted
|
||||
*/
|
||||
scheduling_s *head = nullptr;
|
||||
const efitime_t lateDelay;
|
||||
const efitick_t lateDelay;
|
||||
};
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ struct scheduling_s {
|
|||
/**
|
||||
* timestamp represented as 64-bit value of ticks since MCU start
|
||||
*/
|
||||
volatile efitime_t momentX = 0;
|
||||
volatile efitick_t momentX = 0;
|
||||
|
||||
/**
|
||||
* Scheduler implementation uses a sorted linked list of these scheduling records.
|
||||
|
@ -63,7 +63,7 @@ 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, efitime_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(scheduling_s *scheduling, int delayUs, action_s action) = 0;
|
||||
virtual void cancel(scheduling_s* scheduling) = 0;
|
||||
};
|
||||
|
|
|
@ -63,7 +63,7 @@ void SingleTimerExecutor::scheduleByTimestamp(const char *msg, scheduling_s *sch
|
|||
scheduleByTimestampNt(msg, scheduling, US2NT(timeUs), action);
|
||||
}
|
||||
|
||||
void SingleTimerExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* scheduling, efitime_t nt, action_s action) {
|
||||
void SingleTimerExecutor::scheduleByTimestampNt(const char *msg, scheduling_s* scheduling, efitick_t nt, action_s action) {
|
||||
ScopePerf perf(PE::SingleTimerExecutorScheduleByTimestamp);
|
||||
|
||||
#if EFI_ENABLE_ASSERTS
|
||||
|
|
|
@ -14,7 +14,7 @@ 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, efitime_t timeNt, action_s action) override;
|
||||
void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override;
|
||||
void scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) override;
|
||||
void cancel(scheduling_s* scheduling) override;
|
||||
|
||||
|
|
|
@ -288,22 +288,22 @@ void EngineTestHelper::fireTriggerEvents(int count) {
|
|||
fireTriggerEvents2(count, 5); // 5ms
|
||||
}
|
||||
|
||||
void EngineTestHelper::assertInjectorUpEvent(const char *msg, int eventIndex, efitime_t momentX, long injectorIndex) {
|
||||
void EngineTestHelper::assertInjectorUpEvent(const char *msg, int eventIndex, efitimeus_t momentX, long injectorIndex) {
|
||||
InjectionEvent *event = &engine.injectionEvents.elements[injectorIndex];
|
||||
assertEvent(msg, eventIndex, (void*)turnInjectionPinHigh, momentX, event);
|
||||
}
|
||||
|
||||
void EngineTestHelper::assertInjectorDownEvent(const char *msg, int eventIndex, efitime_t momentX, long injectorIndex) {
|
||||
void EngineTestHelper::assertInjectorDownEvent(const char *msg, int eventIndex, efitimeus_t momentX, long injectorIndex) {
|
||||
InjectionEvent *event = &engine.injectionEvents.elements[injectorIndex];
|
||||
assertEvent(msg, eventIndex, (void*)turnInjectionPinLow, momentX, event);
|
||||
}
|
||||
|
||||
scheduling_s * EngineTestHelper::assertEvent5(const char *msg, int index, void *callback, efitime_t expectedTimestamp) {
|
||||
scheduling_s * EngineTestHelper::assertEvent5(const char *msg, int index, void *callback, efitimeus_t expectedTimestamp) {
|
||||
TestExecutor *executor = &engine.executor;
|
||||
EXPECT_TRUE(executor->size() > index) << msg << " valid index";
|
||||
scheduling_s *event = executor->getForUnitTest(index);
|
||||
assertEqualsM4(msg, " callback up/down", (void*)event->action.getCallback() == (void*) callback, 1);
|
||||
efitime_t start = getTimeNowUs();
|
||||
efitimeus_t start = getTimeNowUs();
|
||||
assertEqualsM4(msg, " timestamp", expectedTimestamp, event->momentX - start);
|
||||
return event;
|
||||
}
|
||||
|
@ -322,12 +322,12 @@ AngleBasedEvent * EngineTestHelper::assertTriggerEvent(const char *msg,
|
|||
return event;
|
||||
}
|
||||
|
||||
scheduling_s * EngineTestHelper::assertScheduling(const char *msg, int index, scheduling_s *expected, void *callback, efitime_t expectedTimestamp) {
|
||||
scheduling_s * EngineTestHelper::assertScheduling(const char *msg, int index, scheduling_s *expected, void *callback, efitimeus_t expectedTimestamp) {
|
||||
scheduling_s * actual = assertEvent5(msg, index, callback, expectedTimestamp);
|
||||
return actual;
|
||||
}
|
||||
|
||||
void EngineTestHelper::assertEvent(const char *msg, int index, void *callback, efitime_t momentX, InjectionEvent *expectedEvent) {
|
||||
void EngineTestHelper::assertEvent(const char *msg, int index, void *callback, efitimeus_t momentX, InjectionEvent *expectedEvent) {
|
||||
scheduling_s *event = assertEvent5(msg, index, callback, momentX);
|
||||
|
||||
InjectionEvent *actualEvent = (InjectionEvent *)event->action.getArgument();
|
||||
|
|
|
@ -81,14 +81,14 @@ public:
|
|||
*/
|
||||
void clearQueue();
|
||||
|
||||
scheduling_s * assertEvent5(const char *msg, int index, void *callback, efitime_t expectedTimestamp);
|
||||
scheduling_s * assertScheduling(const char *msg, int index, scheduling_s *expected, void *callback, efitime_t expectedTimestamp);
|
||||
scheduling_s * assertEvent5(const char *msg, int index, void *callback, efitimeus_t expectedTimestamp);
|
||||
scheduling_s * assertScheduling(const char *msg, int index, scheduling_s *expected, void *callback, efitimeus_t expectedTimestamp);
|
||||
|
||||
AngleBasedEvent * assertTriggerEvent(const char *msg, int index, AngleBasedEvent *expected, void *callback, int triggerEventIndex, angle_t angleOffsetFromTriggerEvent);
|
||||
|
||||
void assertEvent(const char *msg, int index, void *callback, efitime_t momentX, InjectionEvent *event);
|
||||
void assertInjectorUpEvent(const char *msg, int eventIndex, efitime_t momentX, long injectorIndex);
|
||||
void assertInjectorDownEvent(const char *msg, int eventIndex, efitime_t momentX, long injectorIndex);
|
||||
void assertEvent(const char *msg, int index, void *callback, efitimeus_t momentX, InjectionEvent *event);
|
||||
void assertInjectorUpEvent(const char *msg, int eventIndex, efitimeus_t momentX, long injectorIndex);
|
||||
void assertInjectorDownEvent(const char *msg, int eventIndex, efitimeus_t momentX, long injectorIndex);
|
||||
// todo: open question if this is worth a helper method or should be inlined?
|
||||
void assertRpm(int expectedRpm, const char *msg);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ void TestExecutor::scheduleForLater(const char *msg, scheduling_s *scheduling, i
|
|||
scheduleByTimestamp("test", scheduling, getTimeNowUs() + delayUs, action);
|
||||
}
|
||||
|
||||
int TestExecutor::executeAll(efitime_t now) {
|
||||
int TestExecutor::executeAll(efitick_t now) {
|
||||
return schedulingQueue.executeAll(now);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
void cancel(scheduling_s* scheduling) override;
|
||||
|
||||
void clear();
|
||||
int executeAll(efitime_t now);
|
||||
int executeAll(efitick_t now);
|
||||
int size();
|
||||
scheduling_s * getHead();
|
||||
scheduling_s * getForUnitTest(int index);
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
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, efitime_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));
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue