parent
ea987d5317
commit
06437f304f
|
@ -214,41 +214,6 @@ int MockAdcState::getMockAdcValue(int hwChannel) const {
|
||||||
return fakeAdcValues[hwChannel];
|
return fakeAdcValues[hwChannel];
|
||||||
}
|
}
|
||||||
|
|
||||||
StartupFuelPumping::StartupFuelPumping() {
|
|
||||||
isTpsAbove50 = false;
|
|
||||||
pumpsCounter = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartupFuelPumping::setPumpsCounter(int newValue) {
|
|
||||||
if (pumpsCounter != newValue) {
|
|
||||||
pumpsCounter = newValue;
|
|
||||||
|
|
||||||
if (pumpsCounter == PUMPS_TO_PRIME) {
|
|
||||||
efiPrintf("let's squirt prime pulse %.2f", pumpsCounter);
|
|
||||||
pumpsCounter = 0;
|
|
||||||
} else {
|
|
||||||
efiPrintf("setPumpsCounter %d", pumpsCounter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartupFuelPumping::update() {
|
|
||||||
if (Sensor::getOrZero(SensorType::Rpm) == 0) {
|
|
||||||
bool isTpsAbove50 = Sensor::getOrZero(SensorType::DriverThrottleIntent) >= 50;
|
|
||||||
|
|
||||||
if (this->isTpsAbove50 != isTpsAbove50) {
|
|
||||||
setPumpsCounter(pumpsCounter + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
/**
|
|
||||||
* Engine is not stopped - not priming pumping mode
|
|
||||||
*/
|
|
||||||
setPumpsCounter(0);
|
|
||||||
isTpsAbove50 = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if EFI_SIMULATOR
|
#if EFI_SIMULATOR
|
||||||
#define VCS_VERSION "123"
|
#define VCS_VERSION "123"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -673,8 +673,6 @@ static void setDefaultEngineConfiguration() {
|
||||||
engineConfiguration->engineChartSize = 400;
|
engineConfiguration->engineChartSize = 400;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
engineConfiguration->primingSquirtDurationMs = 5;
|
|
||||||
|
|
||||||
engineConfiguration->isMapAveragingEnabled = true;
|
engineConfiguration->isMapAveragingEnabled = true;
|
||||||
engineConfiguration->isWaveAnalyzerEnabled = true;
|
engineConfiguration->isWaveAnalyzerEnabled = true;
|
||||||
|
|
||||||
|
|
|
@ -72,22 +72,6 @@ public:
|
||||||
warningBuffer_t recentWarnings;
|
warningBuffer_t recentWarnings;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* 6 crossing over 50% TPS means pressing and releasing three times
|
|
||||||
* TODO: looks like this code is not finished / not used?
|
|
||||||
*/
|
|
||||||
#define PUMPS_TO_PRIME 6
|
|
||||||
|
|
||||||
class StartupFuelPumping {
|
|
||||||
public:
|
|
||||||
StartupFuelPumping();
|
|
||||||
void update();
|
|
||||||
bool isTpsAbove50;
|
|
||||||
int pumpsCounter;
|
|
||||||
private:
|
|
||||||
void setPumpsCounter(int newValue);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct multispark_state
|
struct multispark_state
|
||||||
{
|
{
|
||||||
efitick_t delay = 0;
|
efitick_t delay = 0;
|
||||||
|
|
|
@ -479,7 +479,7 @@ int16_t tpsErrorDetectionTooLow;+TPS error detection: what throttle % is unreali
|
||||||
int16_t tpsErrorDetectionTooHigh;+TPS error detection: what throttle % is unrealistically high?\nAlso used for accelerator pedal error detection if so equiped.;"%", 1, 0, 100, 110, 0
|
int16_t tpsErrorDetectionTooHigh;+TPS error detection: what throttle % is unrealistically high?\nAlso used for accelerator pedal error detection if so equiped.;"%", 1, 0, 100, 110, 0
|
||||||
|
|
||||||
cranking_parameters_s cranking
|
cranking_parameters_s cranking
|
||||||
float primingSquirtDurationMs;;"*C", 1, 0, -40, 200, 1
|
float unused184;;"",1,0,0,0,0
|
||||||
float ignitionDwellForCrankingMs;+Dwell duration while cranking;"ms", 1, 0, 0, 200, 1
|
float ignitionDwellForCrankingMs;+Dwell duration while cranking;"ms", 1, 0, 0, 200, 1
|
||||||
uint16_t etbRevLimitStart;+Once engine speed passes this value, start reducing ETB angle.;"rpm", 1, 0, 0, 15000, 0
|
uint16_t etbRevLimitStart;+Once engine speed passes this value, start reducing ETB angle.;"rpm", 1, 0, 0, 15000, 0
|
||||||
uint16_t etbRevLimitRange;+This far above 'Soft limiter start', fully close the throttle. At the bottom of the range, throttle control is normal. At the top of the range, the throttle is fully closed.;"rpm", 1, 0, 0, 2000, 0
|
uint16_t etbRevLimitRange;+This far above 'Soft limiter start', fully close the throttle. At the bottom of the range, throttle control is normal. At the top of the range, the throttle is fully closed.;"rpm", 1, 0, 0, 2000, 0
|
||||||
|
|
|
@ -246,42 +246,6 @@ static void testTriggerDecoder3(const char *msg, engine_type_e type, int synchPo
|
||||||
assertEqualsM2("actual gap ratio", expectedGap, actualSynchGap, 0.001);
|
assertEqualsM2("actual gap ratio", expectedGap, actualSynchGap, 0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(misc, testStartupFuelPumping) {
|
|
||||||
EngineTestHelper eth(FORD_INLINE_6_1995);
|
|
||||||
|
|
||||||
StartupFuelPumping sf;
|
|
||||||
|
|
||||||
Sensor::setMockValue(SensorType::Rpm, 0);
|
|
||||||
|
|
||||||
Sensor::setMockValue(SensorType::DriverThrottleIntent, 60);
|
|
||||||
sf.update();
|
|
||||||
ASSERT_EQ( 1, sf.pumpsCounter) << "pc#1";
|
|
||||||
|
|
||||||
Sensor::setMockValue(SensorType::DriverThrottleIntent, 30);
|
|
||||||
sf.update();
|
|
||||||
ASSERT_EQ( 1, sf.pumpsCounter) << "pumpsCounter#2";
|
|
||||||
|
|
||||||
sf.update();
|
|
||||||
ASSERT_EQ( 1, sf.pumpsCounter) << "pc#3";
|
|
||||||
|
|
||||||
Sensor::setMockValue(SensorType::Rpm, 10);
|
|
||||||
sf.update();
|
|
||||||
ASSERT_EQ( 0, sf.pumpsCounter) << "pc#4";
|
|
||||||
|
|
||||||
Sensor::setMockValue(SensorType::DriverThrottleIntent, 70);
|
|
||||||
Sensor::setMockValue(SensorType::Rpm, 0);
|
|
||||||
sf.update();
|
|
||||||
ASSERT_EQ( 1, sf.pumpsCounter) << "pc#5";
|
|
||||||
|
|
||||||
Sensor::setMockValue(SensorType::DriverThrottleIntent, 30);
|
|
||||||
sf.update();
|
|
||||||
ASSERT_EQ( 1, sf.pumpsCounter) << "pc#6";
|
|
||||||
|
|
||||||
Sensor::setMockValue(SensorType::DriverThrottleIntent, 70);
|
|
||||||
sf.update();
|
|
||||||
ASSERT_EQ( 2, sf.pumpsCounter) << "pc#7";
|
|
||||||
}
|
|
||||||
|
|
||||||
static void assertREquals(void *expected, void *actual) {
|
static void assertREquals(void *expected, void *actual) {
|
||||||
ASSERT_EQ((float)(uint64_t)expected, (float)(uint64_t)actual);
|
ASSERT_EQ((float)(uint64_t)expected, (float)(uint64_t)actual);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue