mirror of https://github.com/rusefi/rusefi.git
Compare commits
4 Commits
08378967c4
...
8d661ce22d
Author | SHA1 | Date |
---|---|---|
Matthew Kennedy | 8d661ce22d | |
Matthew Kennedy | 8cf48a177f | |
Matthew Kennedy | 79b796954d | |
Matthew Kennedy | 271b36cb72 |
|
@ -58,8 +58,6 @@ void chDbgAssert(int c, char *msg, void *arg);
|
||||||
#define VCS_VERSION "321"
|
#define VCS_VERSION "321"
|
||||||
#define RUS_EFI_VERSION_TAG "rusEfiVersion"
|
#define RUS_EFI_VERSION_TAG "rusEfiVersion"
|
||||||
|
|
||||||
#define INLINE inline
|
|
||||||
|
|
||||||
#define EFI_ERROR_CODE 0xffffffff
|
#define EFI_ERROR_CODE 0xffffffff
|
||||||
|
|
||||||
#define CCM_OPTIONAL
|
#define CCM_OPTIONAL
|
||||||
|
|
|
@ -375,16 +375,6 @@ void EngineTestHelper::setTriggerType(trigger_type_e trigger) {
|
||||||
applyTriggerWaveform();
|
applyTriggerWaveform();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EngineTestHelper::executeUntil(int timeUs) {
|
|
||||||
scheduling_s *head;
|
|
||||||
while ((head = engine.executor.getHead()) != nullptr) {
|
|
||||||
if (head->momentX > timeUs) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
setTimeAndInvokeEventsUs(head->momentX);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth, injection_mode_e injectionMode) {
|
void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth, injection_mode_e injectionMode) {
|
||||||
setCamOperationMode();
|
setCamOperationMode();
|
||||||
setupSimpleTestEngineWithMaf(eth, injectionMode, trigger_type_e::TT_HALF_MOON);
|
setupSimpleTestEngineWithMaf(eth, injectionMode, trigger_type_e::TT_HALF_MOON);
|
||||||
|
|
|
@ -67,7 +67,6 @@ public:
|
||||||
void smartFireFall(float delayMs);
|
void smartFireFall(float delayMs);
|
||||||
void moveTimeForwardAndInvokeEventsUs(int deltaTimeUs);
|
void moveTimeForwardAndInvokeEventsUs(int deltaTimeUs);
|
||||||
void setTimeAndInvokeEventsUs(int timeNowUs);
|
void setTimeAndInvokeEventsUs(int timeNowUs);
|
||||||
void executeUntil(int timeUs);
|
|
||||||
void moveTimeForwardAndInvokeEventsSec(int deltaTimeSeconds);
|
void moveTimeForwardAndInvokeEventsSec(int deltaTimeSeconds);
|
||||||
/**
|
/**
|
||||||
* both Rise and Fall
|
* both Rise and Fall
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "global_execution_queue.h"
|
#include "global_execution_queue.h"
|
||||||
|
|
||||||
bool_t debugSignalExecutor = false;
|
bool debugSignalExecutor = false;
|
||||||
|
|
||||||
TestExecutor::~TestExecutor() {
|
TestExecutor::~TestExecutor() {
|
||||||
// Flush the queue and reset all scheduling_s at the end of a test's execution
|
// Flush the queue and reset all scheduling_s at the end of a test's execution
|
||||||
|
|
|
@ -31,7 +31,7 @@ TEST(Actuators, AuxValves) {
|
||||||
eth.assertTriggerEvent("a3", 2, &engine->auxValves[1][1].open, (void*)&auxPlainPinTurnOn, 540);
|
eth.assertTriggerEvent("a3", 2, &engine->auxValves[1][1].open, (void*)&auxPlainPinTurnOn, 540);
|
||||||
|
|
||||||
// Execute the action it put on the regular scheduler
|
// Execute the action it put on the regular scheduler
|
||||||
eth.executeUntil(999999);
|
eth.setTimeAndInvokeEventsUs(999999);
|
||||||
|
|
||||||
eth.assertTriggerEvent("a1", 0, &engine->auxValves[0][1].open, (void*)&auxPlainPinTurnOn, 360);
|
eth.assertTriggerEvent("a1", 0, &engine->auxValves[0][1].open, (void*)&auxPlainPinTurnOn, 360);
|
||||||
eth.assertTriggerEvent("a2", 1, &engine->auxValves[1][0].open, (void*)&auxPlainPinTurnOn, 180);
|
eth.assertTriggerEvent("a2", 1, &engine->auxValves[1][0].open, (void*)&auxPlainPinTurnOn, 180);
|
||||||
|
|
|
@ -114,14 +114,14 @@ TEST(nissan, vq_vvt) {
|
||||||
ptrs);
|
ptrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
eth.executeUntil(1473000);
|
eth.setTimeAndInvokeEventsUs(1473000);
|
||||||
ASSERT_EQ(167, round(Sensor::getOrZero(SensorType::Rpm)));
|
ASSERT_EQ(167, round(Sensor::getOrZero(SensorType::Rpm)));
|
||||||
|
|
||||||
eth.executeUntil(1475000);
|
eth.setTimeAndInvokeEventsUs(1475000);
|
||||||
ASSERT_EQ(167, round(Sensor::getOrZero(SensorType::Rpm)));
|
ASSERT_EQ(167, round(Sensor::getOrZero(SensorType::Rpm)));
|
||||||
TriggerCentral *tc = &engine->triggerCentral;
|
TriggerCentral *tc = &engine->triggerCentral;
|
||||||
|
|
||||||
eth.executeUntil(3593000);
|
eth.setTimeAndInvokeEventsUs(3593000);
|
||||||
ASSERT_TRUE(tc->vvtState[0][0].getShaftSynchronized());
|
ASSERT_TRUE(tc->vvtState[0][0].getShaftSynchronized());
|
||||||
|
|
||||||
scheduling_s *head;
|
scheduling_s *head;
|
||||||
|
|
|
@ -170,7 +170,7 @@ static void assertREqualsM(const char *msg, void *expected, void *actual) {
|
||||||
assertEqualsM(msg, (float)(uint64_t)expected, (float)(uint64_t)actual);
|
assertEqualsM(msg, (float)(uint64_t)expected, (float)(uint64_t)actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern bool_t debugSignalExecutor;
|
extern bool debugSignalExecutor;
|
||||||
|
|
||||||
TEST(misc, testRpmCalculator) {
|
TEST(misc, testRpmCalculator) {
|
||||||
EngineTestHelper eth(engine_type_e::FORD_INLINE_6_1995);
|
EngineTestHelper eth(engine_type_e::FORD_INLINE_6_1995);
|
||||||
|
|
Loading…
Reference in New Issue