Merge pull request #1660 from mck1117/test-crosstalk
reduce crosstalk between tests
This commit is contained in:
commit
3293d2999d
|
@ -350,11 +350,11 @@ float getMap(void) {
|
||||||
void initMapAveraging(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
void initMapAveraging(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
logger = sharedLogger;
|
logger = sharedLogger;
|
||||||
|
|
||||||
|
#if !EFI_UNIT_TEST
|
||||||
#if EFI_SHAFT_POSITION_INPUT
|
#if EFI_SHAFT_POSITION_INPUT
|
||||||
addTriggerEventListener(&mapAveragingTriggerCallback, "MAP averaging", engine);
|
addTriggerEventListener(&mapAveragingTriggerCallback, "MAP averaging", engine);
|
||||||
#endif /* EFI_SHAFT_POSITION_INPUT */
|
#endif /* EFI_SHAFT_POSITION_INPUT */
|
||||||
|
|
||||||
#if !EFI_UNIT_TEST
|
|
||||||
addConsoleAction("faststat", showMapStats);
|
addConsoleAction("faststat", showMapStats);
|
||||||
#endif /* EFI_UNIT_TEST */
|
#endif /* EFI_UNIT_TEST */
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,9 @@ void initRpmCalculator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !EFI_UNIT_TEST
|
||||||
addTriggerEventListener(tdcMarkCallback, "chart TDC mark", engine);
|
addTriggerEventListener(tdcMarkCallback, "chart TDC mark", engine);
|
||||||
|
#endif
|
||||||
|
|
||||||
addTriggerEventListener(rpmShaftPositionCallback, "rpm reporter", engine);
|
addTriggerEventListener(rpmShaftPositionCallback, "rpm reporter", engine);
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,5 +209,18 @@ scheduling_s *EventQueue::getElementAtIndexForUnitText(int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventQueue::clear(void) {
|
void EventQueue::clear(void) {
|
||||||
|
// Flush the queue, resetting all scheduling_s as though we'd executed them
|
||||||
|
while(head) {
|
||||||
|
auto x = head;
|
||||||
|
// link next element to head
|
||||||
|
head = x->nextScheduling_s;
|
||||||
|
|
||||||
|
// Reset this element
|
||||||
|
x->momentX = 0;
|
||||||
|
x->isScheduled = false;
|
||||||
|
x->nextScheduling_s = nullptr;
|
||||||
|
x->action = {};
|
||||||
|
}
|
||||||
|
|
||||||
head = nullptr;
|
head = nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,11 @@
|
||||||
bool_t debugSignalExecutor = false;
|
bool_t debugSignalExecutor = false;
|
||||||
extern bool verboseMode;
|
extern bool verboseMode;
|
||||||
|
|
||||||
|
TestExecutor::~TestExecutor() {
|
||||||
|
// Flush the queue and reset all scheduling_s at the end of a test's execution
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
|
||||||
void TestExecutor::scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) {
|
void TestExecutor::scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) {
|
||||||
if (debugSignalExecutor) {
|
if (debugSignalExecutor) {
|
||||||
printf("scheduleTask %d\r\n", delayUs);
|
printf("scheduleTask %d\r\n", delayUs);
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
|
|
||||||
class TestExecutor : public ExecutorInterface {
|
class TestExecutor : public ExecutorInterface {
|
||||||
public:
|
public:
|
||||||
|
~TestExecutor();
|
||||||
|
|
||||||
void scheduleByTimestamp(scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override;
|
void scheduleByTimestamp(scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override;
|
||||||
void scheduleByTimestampNt(scheduling_s *scheduling, efitick_t timeNt, action_s action) override;
|
void scheduleByTimestampNt(scheduling_s *scheduling, efitick_t timeNt, action_s action) override;
|
||||||
void scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) override;
|
void scheduleForLater(scheduling_s *scheduling, int delayUs, action_s action) override;
|
||||||
|
|
Loading…
Reference in New Issue