infer useOnlyRisingEdge by trigger type (#4621)
* most of the plumbing
* easy tests
* trigger types that are rise only
* configs
* change mode of various triggers
* vvt
* 898 test is now impossible 🥳
* s
* instant rpm test
* actually remove useOnlyRisingEdgeForTrigger
* remove vvtCamSensorUseRise
* s
* print
* one happy test
* another test
* happy testSomethingWeird
* happy testCamInput
* maybe fix it a different way
* better
* quad cam
* nb2 happy
* bad merge
* vvt test
* trigger.test1995FordInline6TriggerDecoder
* hellen gm e67
* changelog
This commit is contained in:
parent
1f64cf5844
commit
5c50ad2db4
|
@ -45,6 +45,7 @@ Release template (copy/paste this for new release):
|
|||
|
||||
### Removed
|
||||
- Idle timing deadzone #4729
|
||||
- "Use only rising edge" trigger option - triggers now select automatically based on trigger type #4621
|
||||
|
||||
## September 2022 Release - "Day 203"
|
||||
|
||||
|
|
|
@ -137,7 +137,6 @@ void setBoardDefaultConfiguration() {
|
|||
|
||||
engineConfiguration->enableSoftwareKnock = true;
|
||||
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
engineConfiguration->invertPrimaryTriggerSignal = true;
|
||||
|
||||
|
||||
|
|
|
@ -132,8 +132,6 @@ void setBoardDefaultConfiguration() {
|
|||
// Some sensible defaults for other options
|
||||
setCrankOperationMode();
|
||||
|
||||
engineConfiguration->vvtCamSensorUseRise = true;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
// setAlgorithm(LM_SPEED_DENSITY);
|
||||
// at least this starts
|
||||
engineConfiguration->fuelAlgorithm = LM_ALPHA_N;
|
||||
|
|
|
@ -190,8 +190,6 @@ void setBoardDefaultConfiguration() {
|
|||
// Some sensible defaults for other options
|
||||
setCrankOperationMode();
|
||||
|
||||
engineConfiguration->vvtCamSensorUseRise = true;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
||||
setEtbPID(8.8944, 70.2307, 0.1855);
|
||||
|
|
|
@ -132,15 +132,13 @@ void setBoardDefaultConfiguration() {
|
|||
// Some sensible defaults for other options
|
||||
setCrankOperationMode();
|
||||
|
||||
engineConfiguration->vvtCamSensorUseRise = true;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
||||
|
||||
// Bosch VQ40 VR56 VK56 0280158007
|
||||
engineConfiguration->injector.flow = 296.2;
|
||||
|
||||
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_NISSAN);
|
||||
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_BMW);
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
|
|
|
@ -40,9 +40,6 @@ void setDodgeNeon1995EngineConfiguration() {
|
|||
// set_rpm_hard_limit 4000
|
||||
engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
|
||||
|
||||
|
||||
// engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
/**
|
||||
* that's 1995 config
|
||||
*/
|
||||
|
|
|
@ -75,7 +75,6 @@ void setFordAspireEngineConfiguration() {
|
|||
|
||||
setSingleCoilDwell();
|
||||
engineConfiguration->ignitionMode = IM_ONE_COIL;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
engineConfiguration->trigger.type = TT_FORD_ASPIRE;
|
||||
|
||||
engineConfiguration->triggerInputDebugPins[0] = Gpio::C15;
|
||||
|
|
|
@ -153,7 +153,6 @@ static const uint8_t mapBased16IgnitionTable[16][16] = {
|
|||
|
||||
void miataNAcommonEngineSettings() {
|
||||
engineConfiguration->trigger.type = TT_MAZDA_MIATA_NA;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
||||
engineConfiguration->compressionRatio = 9.1;
|
||||
|
|
|
@ -261,13 +261,11 @@ static void set4EC_AT() {
|
|||
*/
|
||||
static void setCommonMazdaNB() {
|
||||
engineConfiguration->displayLogicLevelsInEngineSniffer = true;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
engineConfiguration->trigger.type = TT_MIATA_VVT;
|
||||
|
||||
// set vvt_mode 3
|
||||
engineConfiguration->vvtMode[0] = VVT_MIATA_NB;
|
||||
engineConfiguration->vvtOffsets[0] = 98; // 2003 red car value
|
||||
engineConfiguration->vvtCamSensorUseRise = true;
|
||||
|
||||
engineConfiguration->ignitionDwellForCrankingMs = 4;
|
||||
// set cranking_fuel 27.5
|
||||
|
|
|
@ -69,7 +69,6 @@ void setSubaruEG33Defaults() {
|
|||
setCamOperationMode();
|
||||
|
||||
engineConfiguration->trigger.type = TT_SUBARU_SVX;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
setLeftRightBanksNeedBetterName();
|
||||
|
|
|
@ -25,7 +25,6 @@ void setTestCamEngineConfiguration() {
|
|||
// trigger_config_s *triggerConfig = &engineConfiguration->trigger;
|
||||
// triggerConfig->customTotalToothCount = 60;
|
||||
// triggerConfig->customSkippedToothCount = 0;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
|
||||
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_1;
|
||||
engineConfiguration->tps1_1AdcChannel = EFI_ADC_2;
|
||||
|
@ -84,20 +83,14 @@ void setTestVVTEngineConfiguration() {
|
|||
void setTestEngineIssue366both() {
|
||||
setTestCamEngineConfiguration();
|
||||
|
||||
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
|
||||
engineConfiguration->trigger.customTotalToothCount = 2;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 1;
|
||||
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
|
||||
}
|
||||
|
||||
void setTestEngineIssue366rise() {
|
||||
setTestEngineIssue366both();
|
||||
|
||||
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
}
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
||||
|
|
|
@ -52,8 +52,6 @@ static void common2jz() {
|
|||
// chartsize 450
|
||||
engineConfiguration->engineChartSize = 450;
|
||||
|
||||
// engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
engineConfiguration->map.sensor.type = MT_CUSTOM;
|
||||
|
||||
engineConfiguration->injector.flow = 430;
|
||||
|
|
|
@ -27,7 +27,6 @@ void setVwAba() {
|
|||
|
||||
setCrankOperationMode();
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_1;
|
||||
|
||||
|
|
|
@ -63,7 +63,6 @@ static void commonPassatB6() {
|
|||
engineConfiguration->throttlePedalSecondaryWOTVoltage = 4.30;
|
||||
|
||||
engineConfiguration->invertCamVVTSignal = true;
|
||||
engineConfiguration->vvtCamSensorUseRise = true;
|
||||
|
||||
/**
|
||||
* PSS-140
|
||||
|
|
|
@ -45,8 +45,6 @@ void setDefaultBaseEngine() {
|
|||
// Trigger
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
|
||||
|
||||
engineConfiguration->globalTriggerAngleOffset = 0;
|
||||
|
||||
// Default this to on - if you want to diagnose, turn it off.
|
||||
|
|
|
@ -215,15 +215,10 @@ void EngineState::updateTChargeK(int rpm, float tps) {
|
|||
#endif
|
||||
|
||||
void TriggerConfiguration::update() {
|
||||
UseOnlyRisingEdgeForTrigger = isUseOnlyRisingEdgeForTrigger();
|
||||
VerboseTriggerSynchDetails = isVerboseTriggerSynchDetails();
|
||||
TriggerType = getType();
|
||||
}
|
||||
|
||||
bool PrimaryTriggerConfiguration::isUseOnlyRisingEdgeForTrigger() const {
|
||||
return engineConfiguration->useOnlyRisingEdgeForTrigger;
|
||||
}
|
||||
|
||||
trigger_config_s PrimaryTriggerConfiguration::getType() const {
|
||||
return engineConfiguration->trigger;
|
||||
}
|
||||
|
@ -232,10 +227,6 @@ bool PrimaryTriggerConfiguration::isVerboseTriggerSynchDetails() const {
|
|||
return engineConfiguration->verboseTriggerSynchDetails;
|
||||
}
|
||||
|
||||
bool VvtTriggerConfiguration::isUseOnlyRisingEdgeForTrigger() const {
|
||||
return engineConfiguration->vvtCamSensorUseRise;
|
||||
}
|
||||
|
||||
trigger_config_s VvtTriggerConfiguration::getType() const {
|
||||
// Convert from VVT type to trigger_config_s
|
||||
return { getVvtTriggerType(engineConfiguration->vvtMode[index]), 0, 0 };
|
||||
|
|
|
@ -406,8 +406,7 @@ void prepareOutputSignals() {
|
|||
|
||||
#if EFI_UNIT_TEST
|
||||
if (verboseMode) {
|
||||
printf("prepareOutputSignals %d onlyEdge=%s %s\r\n", engineConfiguration->trigger.type, boolToString(engineConfiguration->useOnlyRisingEdgeForTrigger),
|
||||
getIgnition_mode_e(engineConfiguration->ignitionMode));
|
||||
printf("prepareOutputSignals %d %s\r\n", engineConfiguration->trigger.type, getIgnition_mode_e(engineConfiguration->ignitionMode));
|
||||
}
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
||||
|
|
|
@ -691,9 +691,6 @@ static void enableOrDisable(const char *param, bool isEnabled) {
|
|||
#endif /* EFI_PROD_CODE */
|
||||
} else if (strEqualCaseInsensitive(param, "stepperidle")) {
|
||||
engineConfiguration->useStepperIdle = isEnabled;
|
||||
} else if (strEqualCaseInsensitive(param, "trigger_only_front")) {
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = isEnabled;
|
||||
incrementGlobalConfigurationVersion();
|
||||
} else if (strEqualCaseInsensitive(param, "two_wire_batch_injection")) {
|
||||
engineConfiguration->twoWireBatchInjection = isEnabled;
|
||||
incrementGlobalConfigurationVersion();
|
||||
|
@ -871,8 +868,6 @@ static void getValue(const char *paramStr) {
|
|||
#endif /* EFI_PROD_CODE */
|
||||
} else if (strEqualCaseInsensitive(paramStr, "tps_min")) {
|
||||
efiPrintf("tps_min=%d", engineConfiguration->tpsMin);
|
||||
} else if (strEqualCaseInsensitive(paramStr, "trigger_only_front")) {
|
||||
efiPrintf("trigger_only_front=%d", engineConfiguration->useOnlyRisingEdgeForTrigger);
|
||||
} else if (strEqualCaseInsensitive(paramStr, "tps_max")) {
|
||||
efiPrintf("tps_max=%d", engineConfiguration->tpsMax);
|
||||
} else if (strEqualCaseInsensitive(paramStr, "global_trigger_offset_angle")) {
|
||||
|
@ -885,8 +880,6 @@ static void getValue(const char *paramStr) {
|
|||
efiPrintf("is_enabled_spi_2=%s", boolToString(engineConfiguration->is_enabled_spi_2));
|
||||
} else if (strEqualCaseInsensitive(paramStr, "is_enabled_spi_3")) {
|
||||
efiPrintf("is_enabled_spi_3=%s", boolToString(engineConfiguration->is_enabled_spi_3));
|
||||
} else if (strEqualCaseInsensitive(paramStr, "vvtCamSensorUseRise")) {
|
||||
efiPrintf("vvtCamSensorUseRise=%s", boolToString(engineConfiguration->vvtCamSensorUseRise));
|
||||
} else if (strEqualCaseInsensitive(paramStr, "invertCamVVTSignal")) {
|
||||
efiPrintf("invertCamVVTSignal=%s", boolToString(engineConfiguration->invertCamVVTSignal));
|
||||
} else if (strEqualCaseInsensitive(paramStr, "isHip9011Enabled")) {
|
||||
|
@ -1070,8 +1063,6 @@ static void setValue(const char *paramStr, const char *valueStr) {
|
|||
engineConfiguration->vvtOffsets[0] = valueF;
|
||||
} else if (strEqualCaseInsensitive(paramStr, "vvt_mode")) {
|
||||
engineConfiguration->vvtMode[0] = (vvt_mode_e)valueI;
|
||||
} else if (strEqualCaseInsensitive(paramStr, "vvtCamSensorUseRise")) {
|
||||
engineConfiguration->vvtCamSensorUseRise = valueI;
|
||||
} else if (strEqualCaseInsensitive(paramStr, "wwaeTau")) {
|
||||
engineConfiguration->wwaeTau = valueF;
|
||||
} else if (strEqualCaseInsensitive(paramStr, "wwaeBeta")) {
|
||||
|
|
|
@ -53,6 +53,9 @@ void TriggerWaveform::initialize(operation_mode_e operationMode, SyncEdge syncEd
|
|||
needSecondTriggerInput = false;
|
||||
shapeWithoutTdc = false;
|
||||
|
||||
// If RiseOnly, ignore falling edges completely.
|
||||
useOnlyRisingEdges = syncEdge == SyncEdge::RiseOnly;
|
||||
|
||||
setTriggerSynchronizationGap(2);
|
||||
for (int gapIndex = 1; gapIndex < GAP_TRACKING_LENGTH ; gapIndex++) {
|
||||
// NaN means do not use this gap ratio
|
||||
|
@ -411,10 +414,7 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
|
|||
|
||||
shapeDefinitionError = false;
|
||||
|
||||
this->useOnlyRisingEdges = triggerConfig.UseOnlyRisingEdgeForTrigger;
|
||||
|
||||
switch (triggerConfig.TriggerType.type) {
|
||||
|
||||
case TT_TOOTHED_WHEEL:
|
||||
initializeSkippedToothTrigger(this, triggerConfig.TriggerType.customTotalToothCount,
|
||||
triggerConfig.TriggerType.customSkippedToothCount, triggerOperationMode, SyncEdge::RiseOnly);
|
||||
|
@ -729,12 +729,4 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
|
|||
if (!shapeDefinitionError) {
|
||||
wave.checkSwitchTimes(getCycleDuration());
|
||||
}
|
||||
|
||||
if (syncEdge == SyncEdge::Both && useOnlyRisingEdges) {
|
||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||
firmwareError(CUSTOM_ERR_BOTH_FRONTS_REQUIRED, "trigger: both fronts required");
|
||||
#else
|
||||
warning(CUSTOM_ERR_BOTH_FRONTS_REQUIRED, "trigger: both fronts required");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,7 +111,8 @@ void InstantRpmCalculator::setLastEventTimeForInstantRpm(efitick_t nowNt) {
|
|||
|
||||
// If we are using only rising edges, we never write in to the odd-index slots that
|
||||
// would be used by falling edges
|
||||
spinningEventIndex += engineConfiguration->useOnlyRisingEdgeForTrigger ? 2 : 1;
|
||||
// TODO: don't reach across to trigger central to get this info
|
||||
spinningEventIndex += getTriggerCentral()->triggerShape.useOnlyRisingEdges ? 2 : 1;
|
||||
}
|
||||
|
||||
void InstantRpmCalculator::updateInstantRpm(
|
||||
|
|
|
@ -459,7 +459,7 @@ void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp) {
|
|||
// We want to do this before anything else as we
|
||||
// actually want to capture any noise/jitter that may be occurring
|
||||
|
||||
bool logLogicState = engineConfiguration->displayLogicLevelsInEngineSniffer && engineConfiguration->useOnlyRisingEdgeForTrigger;
|
||||
bool logLogicState = engineConfiguration->displayLogicLevelsInEngineSniffer && getTriggerCentral()->triggerShape.useOnlyRisingEdges;
|
||||
|
||||
if (!logLogicState) {
|
||||
// we log physical state even if displayLogicLevelsInEngineSniffer if both fronts are used by decoder
|
||||
|
@ -807,11 +807,10 @@ void triggerInfo(void) {
|
|||
|
||||
#endif /* HAL_TRIGGER_USE_PAL */
|
||||
|
||||
efiPrintf("Template %s (%d) trigger %s (%d) syncEdge=%s useRiseEdge=%s tdcOffset=%.2f",
|
||||
efiPrintf("Template %s (%d) trigger %s (%d) syncEdge=%s tdcOffset=%.2f",
|
||||
getEngine_type_e(engineConfiguration->engineType), engineConfiguration->engineType,
|
||||
getTrigger_type_e(engineConfiguration->trigger.type), engineConfiguration->trigger.type,
|
||||
getSyncEdge(TRIGGER_WAVEFORM(syncEdge)), boolToString(engineConfiguration->useOnlyRisingEdgeForTrigger),
|
||||
TRIGGER_WAVEFORM(tdcPosition));
|
||||
getSyncEdge(TRIGGER_WAVEFORM(syncEdge)), TRIGGER_WAVEFORM(tdcPosition));
|
||||
|
||||
if (engineConfiguration->trigger.type == TT_TOOTHED_WHEEL) {
|
||||
efiPrintf("total %d/skipped %d", engineConfiguration->trigger.customTotalToothCount,
|
||||
|
@ -926,11 +925,9 @@ void onConfigurationChangeTriggerCallback() {
|
|||
changed |= isConfigurationChanged(trigger.type);
|
||||
changed |= isConfigurationChanged(skippedWheelOnCam);
|
||||
changed |= isConfigurationChanged(twoStroke);
|
||||
changed |= isConfigurationChanged(useOnlyRisingEdgeForTrigger);
|
||||
changed |= isConfigurationChanged(globalTriggerAngleOffset);
|
||||
changed |= isConfigurationChanged(trigger.customTotalToothCount);
|
||||
changed |= isConfigurationChanged(trigger.customSkippedToothCount);
|
||||
changed |= isConfigurationChanged(vvtCamSensorUseRise);
|
||||
changed |= isConfigurationChanged(overrideTriggerGaps);
|
||||
|
||||
if (changed) {
|
||||
|
|
|
@ -29,12 +29,10 @@ public:
|
|||
void update();
|
||||
|
||||
const char* const PrintPrefix;
|
||||
bool UseOnlyRisingEdgeForTrigger;
|
||||
bool VerboseTriggerSynchDetails;
|
||||
trigger_config_s TriggerType;
|
||||
|
||||
protected:
|
||||
virtual bool isUseOnlyRisingEdgeForTrigger() const = 0;
|
||||
virtual bool isVerboseTriggerSynchDetails() const = 0;
|
||||
virtual trigger_config_s getType() const = 0;
|
||||
};
|
||||
|
@ -44,7 +42,6 @@ public:
|
|||
PrimaryTriggerConfiguration() : TriggerConfiguration("TRG ") {}
|
||||
|
||||
protected:
|
||||
bool isUseOnlyRisingEdgeForTrigger() const override;
|
||||
bool isVerboseTriggerSynchDetails() const override;
|
||||
trigger_config_s getType() const override;
|
||||
};
|
||||
|
@ -57,7 +54,6 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
bool isUseOnlyRisingEdgeForTrigger() const override;
|
||||
bool isVerboseTriggerSynchDetails() const override;
|
||||
trigger_config_s getType() const override;
|
||||
};
|
||||
|
|
|
@ -139,6 +139,7 @@ expected<uint32_t> TriggerStimulatorHelper::findTriggerSyncPoint(
|
|||
}
|
||||
}
|
||||
shape.setShapeDefinitionError(true);
|
||||
warning(CUSTOM_ERR_TRIGGER_SYNC, "findTriggerZeroEventIndex() failed");
|
||||
|
||||
firmwareError(CUSTOM_ERR_TRIGGER_SYNC, "findTriggerZeroEventIndex() failed");
|
||||
return unexpected;
|
||||
}
|
||||
|
|
|
@ -769,7 +769,7 @@ bit is_enabled_spi_2
|
|||
bit enableVerboseCanTx;CAN broadcast using custom rusEFI protocol\nenable can_broadcast/disable can_broadcast
|
||||
bit unusedAlteOnOff
|
||||
bit isCJ125Enabled;enable cj125/disable cj125
|
||||
bit vvtCamSensorUseRise,"Rising","Falling";Use rise or fall signal front\nget vvtCamSensorUseRise
|
||||
bit unused764b17
|
||||
bit measureMapOnlyInOneCylinder;Useful for individual intakes
|
||||
bit stepperForceParkingEveryRestart
|
||||
bit isFasterEngineSpinUpEnabled;If enabled, try to fire the engine before a full engine cycle has been completed using RPM estimated from the last 90 degrees of engine rotation. As soon as the trigger syncs plus 90 degrees rotation, fuel and ignition events will occur. If disabled, worst case may require up to 4 full crank rotations before any events are scheduled.
|
||||
|
@ -1067,7 +1067,7 @@ custom idle_mode_e 1 bits, U08, @OFFSET@, [0:0], "Open Loop + Closed Loop", "Ope
|
|||
bit verboseTriggerSynchDetails;Verbose info in console below engineSnifferRpmThreshold\nenable trigger_details
|
||||
bit isManualSpinningMode;Usually if we have no trigger events that means engine is stopped\nUnless we are troubleshooting and spinning the engine by hand - this case a longer\ndelay is needed
|
||||
bit twoWireBatchInjection;This is needed if your coils are individually wired and you wish to use batch injection.\nenable two_wire_batch_injection
|
||||
bit useOnlyRisingEdgeForTrigger;VR sensors are only precise on rising front\nenable trigger_only_front
|
||||
bit unused1372b13
|
||||
bit twoWireBatchIgnition;This is needed if your coils are individually wired (COP) and you wish to use batch ignition (Wasted Spark).
|
||||
bit useFixedBaroCorrFromMap
|
||||
bit useSeparateAdvanceForCranking,"Table","Fixed (auto taper)";In Constant mode, timing is automatically tapered to running as RPM increases.\nIn Table mode, the "Cranking ignition advance" table is used directly.
|
||||
|
|
|
@ -2143,8 +2143,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
|
|||
; see also in firmware '[doesTriggerImplyOperationMode]' tag
|
||||
field = "What kind of engine", twoStroke
|
||||
field = "Skipped wheel location", skippedWheelOnCam, 1, { twoStroke == 0 && (trigger_type == @@trigger_type_e_TT_TOOTHED_WHEEL@@ || @@TRIGGER_TYPE_WITHOUT_KNOWN_LOCATION@@) }
|
||||
field = "With VR sensors only rising edge has reliable position"
|
||||
field = "use only rising edge", useOnlyRisingEdgeForTrigger
|
||||
field = "!Reminder that 4-stroke cycle is 720 degrees"
|
||||
field = "!For well-known trigger types use '0' trigger angle offset"
|
||||
field = "Trigger Angle Advance", globalTriggerAngleOffset
|
||||
|
@ -2175,7 +2173,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
|
|||
field = "Cam mode (intake cams)", vvtMode1, {trigger_type != @@trigger_type_e_TT_MAZDA_MIATA_NA@@}
|
||||
field = "MAP readout angle", mapCamDetectionAnglePosition, { vvtMode1 == @@vvt_mode_e_VVT_MAP_V_TWIN@@ }
|
||||
field = "Cam mode (exhaust cams)", vvtMode2, {trigger_type != @@trigger_type_e_TT_MAZDA_MIATA_NA@@}
|
||||
field = "VVT sync edge", vvtCamSensorUseRise, {trigger_type != @@trigger_type_e_TT_MAZDA_MIATA_NA@@}
|
||||
field = "Cam for engine sync resolution", engineSyncCam, { vvtMode1 != @@vvt_mode_e_VVT_INACTIVE@@ || vvtMode2 != @@vvt_mode_e_VVT_INACTIVE@@ }
|
||||
field = "#Set offset so VVT indicates 0 degrees in default position"
|
||||
field = "VVT offset bank 1 intake", vvtOffsets1, { camInputs1 != 0 }
|
||||
|
|
|
@ -21,7 +21,6 @@ TEST(Actuators, Tachometer) {
|
|||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
engineConfiguration->trigger.customTotalToothCount = 8;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 0;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
|
||||
setCamOperationMode();
|
||||
eth.applyTriggerWaveform();
|
||||
|
||||
|
|
|
@ -86,7 +86,6 @@ TEST(misc, testFuelMap) {
|
|||
|
||||
static void configureFordAspireTriggerWaveform(TriggerWaveform * s) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::Rise);
|
||||
s->useOnlyRisingEdges = false;
|
||||
|
||||
s->addEvent720(53.747, TriggerWheel::T_SECONDARY, TriggerValue::RISE);
|
||||
s->addEvent720(121.90, TriggerWheel::T_SECONDARY, TriggerValue::FALL);
|
||||
|
|
|
@ -66,7 +66,6 @@ TEST(fuel, testWallWettingEnrichmentScheduling) {
|
|||
engineConfiguration->isFasterEngineSpinUpEnabled = false;
|
||||
|
||||
setCrankOperationMode();
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
eth.setTriggerType(TT_ONE);
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ TEST(issues, issueOneCylinderSpecialCase968) {
|
|||
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
||||
|
||||
setCrankOperationMode();
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
eth.setTriggerType(TT_ONE);
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ TEST(fuel, testTpsAccelEnrichmentScheduling) {
|
|||
EngineTestHelper eth(FORD_ASPIRE_1996);
|
||||
|
||||
setCrankOperationMode();
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
engineConfiguration->tpsAccelEnrichmentThreshold = 5;
|
||||
engineConfiguration->tpsAccelLookback = 2;
|
||||
|
|
|
@ -84,7 +84,6 @@ TEST(trigger, testCamInput) {
|
|||
|
||||
// changing to 'ONE TOOTH' trigger on CRANK with CAM/VVT
|
||||
setCrankOperationMode();
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
engineConfiguration->vvtMode[0] = VVT_FIRST_HALF;
|
||||
engineConfiguration->vvtOffsets[0] = 360;
|
||||
eth.setTriggerType(TT_ONE);
|
||||
|
@ -93,14 +92,16 @@ TEST(trigger, testCamInput) {
|
|||
ASSERT_EQ( 0, round(Sensor::getOrZero(SensorType::Rpm))) << "testCamInput RPM";
|
||||
|
||||
for (int i = 0; i < 5;i++) {
|
||||
eth.fireRise(50);
|
||||
eth.fireRise(25);
|
||||
eth.fireFall(25);
|
||||
}
|
||||
|
||||
ASSERT_EQ(1200, round(Sensor::getOrZero(SensorType::Rpm))) << "testCamInput RPM";
|
||||
ASSERT_EQ(1200, round(Sensor::getOrZero(SensorType::Rpm)));
|
||||
ASSERT_EQ(0, unitTestWarningCodeState.recentWarnings.getCount()) << "warningCounter#testCamInput";
|
||||
|
||||
for (int i = 0; i < 600;i++) {
|
||||
eth.fireRise(50);
|
||||
eth.fireRise(25);
|
||||
eth.fireFall(25);
|
||||
}
|
||||
|
||||
// asserting that lack of camshaft signal would be detecting
|
||||
|
@ -109,15 +110,25 @@ TEST(trigger, testCamInput) {
|
|||
unitTestWarningCodeState.recentWarnings.clear();
|
||||
|
||||
for (int i = 0; i < 600;i++) {
|
||||
eth.moveTimeForwardUs(MS2US(10));
|
||||
hwHandleVvtCamSignal(TriggerValue::RISE, getTimeNowNt(), 0);
|
||||
eth.moveTimeForwardUs(MS2US(40));
|
||||
eth.moveTimeForwardUs(MS2US(25));
|
||||
|
||||
eth.firePrimaryTriggerRise();
|
||||
EXPECT_EQ(1200, round(Sensor::getOrZero(SensorType::Rpm)));
|
||||
|
||||
eth.moveTimeForwardUs(MS2US(10));
|
||||
|
||||
// cam comes every other crank rev
|
||||
if (i % 2 == 0) {
|
||||
hwHandleVvtCamSignal(TriggerValue::RISE, getTimeNowNt(), 0);
|
||||
}
|
||||
|
||||
eth.moveTimeForwardUs(MS2US(15));
|
||||
eth.firePrimaryTriggerFall();
|
||||
}
|
||||
|
||||
// asserting that error code has cleared
|
||||
ASSERT_EQ(0, unitTestWarningCodeState.recentWarnings.getCount()) << "warningCounter#testCamInput #3";
|
||||
EXPECT_NEAR_M3(-181, engine->triggerCentral.getVVTPosition(0, 0));
|
||||
ASSERT_EQ(0, unitTestWarningCodeState.recentWarnings.getCount()) << "warningCounter#testCamInput #3";
|
||||
EXPECT_NEAR_M3(-109, engine->triggerCentral.getVVTPosition(0, 0));
|
||||
}
|
||||
|
||||
TEST(trigger, testNB2CamInput) {
|
||||
|
@ -125,8 +136,6 @@ TEST(trigger, testNB2CamInput) {
|
|||
|
||||
engineConfiguration->isFasterEngineSpinUpEnabled = false;
|
||||
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
ASSERT_EQ( 0, round(Sensor::getOrZero(SensorType::Rpm)));
|
||||
for (int i = 0; i < 6;i++) {
|
||||
eth.fireRise(25 * 70 / 180);
|
||||
|
|
|
@ -110,24 +110,6 @@ static void doTestFasterEngineSpinningUp60_2(int startUpDelayMs, int rpm1, int e
|
|||
setupSimpleTestEngineWithMaf(ð, IM_SEQUENTIAL, TT_TOOTHED_WHEEL_60_2);
|
||||
eth.moveTimeForwardMs(startUpDelayMs);
|
||||
|
||||
// fire 30 tooth rise/fall signals
|
||||
eth.fireTriggerEvents2(30 /* count */, 1 /*ms*/);
|
||||
// now fire missed tooth rise/fall
|
||||
eth.fireRise(5 /*ms*/);
|
||||
EXPECT_EQ(rpm1, round(Sensor::getOrZero(SensorType::Rpm))) << "test RPM: After rise " << std::to_string(startUpDelayMs);
|
||||
eth.fireFall(1 /*ms*/);
|
||||
EXPECT_EQ(expectedRpm, round(Sensor::getOrZero(SensorType::Rpm))) << "test RPM: with " << std::to_string(startUpDelayMs) << " startUpDelayMs";
|
||||
}
|
||||
|
||||
static void doTestFasterEngineSpinningUp60_2_onlyRise(int startUpDelayMs, int rpm1, int expectedRpm) {
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
// turn on FasterEngineSpinUp mode
|
||||
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
setupSimpleTestEngineWithMaf(ð, IM_SEQUENTIAL, TT_TOOTHED_WHEEL_60_2);
|
||||
eth.moveTimeForwardMs(startUpDelayMs);
|
||||
|
||||
// fire 30 tooth rise/fall signals
|
||||
eth.fireTriggerEvents2(30 /* count */, 1 /*ms*/);
|
||||
// now fire missed tooth rise/fall
|
||||
|
@ -145,8 +127,4 @@ TEST(cranking, testFasterEngineSpinningUp60_2) {
|
|||
doTestFasterEngineSpinningUp60_2(0, 1000, 1000);
|
||||
doTestFasterEngineSpinningUp60_2(100, 1000, 1000);
|
||||
doTestFasterEngineSpinningUp60_2(1000, 1000, 1000);
|
||||
|
||||
doTestFasterEngineSpinningUp60_2_onlyRise(0, 1000, 1000);
|
||||
doTestFasterEngineSpinningUp60_2_onlyRise(100, 1000, 1000);
|
||||
doTestFasterEngineSpinningUp60_2_onlyRise(1000, 1000, 1000);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ TEST(trigger, testQuadCam) {
|
|||
setCrankOperationMode();
|
||||
|
||||
// changing to 'ONE TOOTH' trigger on CRANK with CAM/VVT
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
engineConfiguration->vvtMode[0] = VVT_FIRST_HALF;
|
||||
engineConfiguration->vvtMode[1] = VVT_FIRST_HALF;
|
||||
|
||||
|
@ -23,22 +22,24 @@ TEST(trigger, testQuadCam) {
|
|||
// this crank trigger would be easier to test, crank shape is less important for this test
|
||||
eth.setTriggerType(TT_ONE);
|
||||
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
engineConfiguration->vvtCamSensorUseRise = true;
|
||||
|
||||
ASSERT_EQ(0, Sensor::getOrZero(SensorType::Rpm));
|
||||
|
||||
eth.fireRise(25);
|
||||
eth.fireFall(12.5);
|
||||
eth.fireRise(12.5);
|
||||
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm));
|
||||
|
||||
eth.fireRise(25);
|
||||
eth.fireFall(12.5);
|
||||
eth.fireRise(12.5);
|
||||
// first time we have RPM
|
||||
ASSERT_EQ(2400, Sensor::getOrZero(SensorType::Rpm));
|
||||
|
||||
// need to be out of VVT sync to see VVT sync in action
|
||||
eth.fireRise(25);
|
||||
eth.fireRise(25);
|
||||
eth.fireRise(25);
|
||||
eth.fireFall(12.5);
|
||||
eth.fireRise(12.5);
|
||||
eth.fireFall(12.5);
|
||||
eth.fireRise(12.5);
|
||||
eth.fireFall(12.5);
|
||||
eth.fireRise(12.5);
|
||||
|
||||
eth.moveTimeForwardUs(MS2US(3)); // shifting VVT phase a few angles
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ static void test(int engineSyncCam, float camOffsetAdd) {
|
|||
|
||||
EXPECT_NEAR(engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/0), 1.351, 1e-2);
|
||||
EXPECT_NEAR(engine->triggerCentral.getVVTPosition(/*bankIndex*/1, /*camIndex*/0), 1.548, 1e-2);
|
||||
ASSERT_EQ(101, round(Sensor::getOrZero(SensorType::Rpm)))<< reader.lineIndex();
|
||||
ASSERT_EQ(102, round(Sensor::getOrZero(SensorType::Rpm)))<< reader.lineIndex();
|
||||
|
||||
// TODO: why warnings?
|
||||
ASSERT_EQ(2, eth.recentWarnings()->getCount());
|
||||
|
|
|
@ -119,27 +119,18 @@ TEST(trigger, testSomethingWeird) {
|
|||
|
||||
ASSERT_FALSE(sta->shaft_is_synchronized) << "shaft_is_synchronized";
|
||||
int r = 10;
|
||||
sta->decodeTriggerEvent("t", engine->triggerCentral.triggerShape, /* override */ nullptr, triggerConfiguration, SHAFT_PRIMARY_FALLING, r);
|
||||
ASSERT_FALSE(sta->shaft_is_synchronized) << "shaft_is_synchronized"; // still no synchronization
|
||||
sta->decodeTriggerEvent("t", engine->triggerCentral.triggerShape, /* override */ nullptr, triggerConfiguration, SHAFT_PRIMARY_RISING, ++r);
|
||||
ASSERT_TRUE(sta->shaft_is_synchronized); // first signal rise synchronize
|
||||
ASSERT_EQ(0, sta->getCurrentIndex());
|
||||
sta->decodeTriggerEvent("t", engine->triggerCentral.triggerShape, /* override */ nullptr, triggerConfiguration, SHAFT_PRIMARY_FALLING, r++);
|
||||
ASSERT_EQ(1, sta->getCurrentIndex());
|
||||
|
||||
for (int i = 2; i < 10;) {
|
||||
for (int i = 2; i < 10; i += 2) {
|
||||
sta->decodeTriggerEvent("t", engine->triggerCentral.triggerShape, /* override */ nullptr, triggerConfiguration, SHAFT_PRIMARY_RISING, r++);
|
||||
assertEqualsM("even", i++, sta->getCurrentIndex());
|
||||
sta->decodeTriggerEvent("t", engine->triggerCentral.triggerShape, /* override */ nullptr, triggerConfiguration, SHAFT_PRIMARY_FALLING, r++);
|
||||
assertEqualsM("odd", i++, sta->getCurrentIndex());
|
||||
assertEqualsM("even", i, sta->getCurrentIndex());
|
||||
}
|
||||
|
||||
sta->decodeTriggerEvent("test", engine->triggerCentral.triggerShape, /* override */ nullptr, triggerConfiguration, SHAFT_PRIMARY_RISING, r++);
|
||||
ASSERT_EQ(10, sta->getCurrentIndex());
|
||||
|
||||
sta->decodeTriggerEvent("test", engine->triggerCentral.triggerShape, /* override */ nullptr, triggerConfiguration, SHAFT_PRIMARY_FALLING, r++);
|
||||
ASSERT_EQ(11, sta->getCurrentIndex());
|
||||
|
||||
sta->decodeTriggerEvent("test", engine->triggerCentral.triggerShape, /* override */ nullptr, triggerConfiguration, SHAFT_PRIMARY_RISING, r++);
|
||||
ASSERT_EQ(0, sta->getCurrentIndex()); // new revolution
|
||||
}
|
||||
|
@ -163,7 +154,7 @@ TEST(trigger, test1995FordInline6TriggerDecoder) {
|
|||
assertTriggerPosition(&position, 0, 0);
|
||||
|
||||
position.setAngle(200);
|
||||
assertTriggerPosition(&position, 3, 20);
|
||||
assertTriggerPosition(&position, 2, 80);
|
||||
|
||||
position.setAngle(360);
|
||||
assertTriggerPosition(&position, 6, 0);
|
||||
|
@ -274,13 +265,13 @@ TEST(misc, testRpmCalculator) {
|
|||
ASSERT_EQ(0, round(Sensor::getOrZero(SensorType::Rpm)));
|
||||
|
||||
// triggerIndexByAngle update is now fixed! prepareOutputSignals() wasn't reliably called
|
||||
ASSERT_EQ(5, engine->triggerCentral.triggerShape.findAngleIndex(&engine->triggerCentral.triggerFormDetails, 240));
|
||||
ASSERT_EQ(5, engine->triggerCentral.triggerShape.findAngleIndex(&engine->triggerCentral.triggerFormDetails, 241));
|
||||
ASSERT_EQ(4, engine->triggerCentral.triggerShape.findAngleIndex(&engine->triggerCentral.triggerFormDetails, 240));
|
||||
ASSERT_EQ(4, engine->triggerCentral.triggerShape.findAngleIndex(&engine->triggerCentral.triggerFormDetails, 241));
|
||||
|
||||
eth.fireTriggerEvents(/* count */ 48);
|
||||
|
||||
ASSERT_EQ( 1500, round(Sensor::getOrZero(SensorType::Rpm))) << "RPM";
|
||||
ASSERT_EQ( 15, engine->triggerCentral.triggerState.getCurrentIndex()) << "index #1";
|
||||
ASSERT_EQ( 14, engine->triggerCentral.triggerState.getCurrentIndex()) << "index #1";
|
||||
|
||||
|
||||
eth.executeActions();
|
||||
|
@ -332,15 +323,15 @@ TEST(misc, testRpmCalculator) {
|
|||
eth.fireFall(5);
|
||||
eth.fireRise(5);
|
||||
eth.fireFall(5);
|
||||
ASSERT_EQ( 3, eth.engine.triggerCentral.triggerState.getCurrentIndex()) << "index #3";
|
||||
ASSERT_EQ( 2, eth.engine.triggerCentral.triggerState.getCurrentIndex()) << "index #3";
|
||||
ASSERT_EQ( 4, engine->executor.size()) << "queue size 3";
|
||||
assertEqualsM("ev 3", start + 13333 - 1515 + 2459, engine->executor.getForUnitTest(0)->momentX);
|
||||
assertEqualsM2("ev 5", start + 14277 + 500, engine->executor.getForUnitTest(1)->momentX, 2);
|
||||
assertEqualsM("3/3", start + 14777 + 677, engine->executor.getForUnitTest(2)->momentX);
|
||||
engine->executor.clear();
|
||||
|
||||
ASSERT_EQ(5, engine->triggerCentral.triggerShape.findAngleIndex(&engine->triggerCentral.triggerFormDetails, 240));
|
||||
ASSERT_EQ(5, engine->triggerCentral.triggerShape.findAngleIndex(&engine->triggerCentral.triggerFormDetails, 241));
|
||||
ASSERT_EQ(4, engine->triggerCentral.triggerShape.findAngleIndex(&engine->triggerCentral.triggerFormDetails, 240));
|
||||
ASSERT_EQ(4, engine->triggerCentral.triggerShape.findAngleIndex(&engine->triggerCentral.triggerFormDetails, 241));
|
||||
|
||||
|
||||
eth.fireFall(5);
|
||||
|
@ -380,20 +371,12 @@ TEST(misc, testRpmCalculator) {
|
|||
engine->executor.clear();
|
||||
|
||||
eth.fireRise(5 /*ms*/);
|
||||
ASSERT_EQ( 2, engine->executor.size()) << "queue size 8";
|
||||
eth.fireFall(5);
|
||||
|
||||
ASSERT_EQ( 4, engine->executor.size()) << "queue size 8";
|
||||
assertEqualsM("8/0", start + 53333 - 1515 + 2459, engine->executor.getForUnitTest(0)->momentX);
|
||||
assertEqualsM2("8/1", start + 54277 + 2459 - 1959, engine->executor.getForUnitTest(1)->momentX, 0);
|
||||
engine->executor.clear();
|
||||
|
||||
|
||||
eth.fireFall(5);
|
||||
ASSERT_EQ( 2, engine->executor.size()) << "queue size 9";
|
||||
engine->executor.clear();
|
||||
|
||||
|
||||
eth.fireRise(5);
|
||||
ASSERT_EQ( 0, engine->executor.size()) << "queue size 10";
|
||||
engine->executor.clear();
|
||||
}
|
||||
|
||||
TEST(trigger, testAnotherTriggerDecoder) {
|
||||
|
@ -409,7 +392,6 @@ TEST(trigger, testTriggerDecoder) {
|
|||
EngineTestHelperBase base(&e, &c.engineConfiguration, &c);
|
||||
TriggerWaveform * s = &e.triggerCentral.triggerShape;
|
||||
|
||||
s->useOnlyRisingEdges = false;
|
||||
initializeSkippedToothTrigger(s, 2, 0, FOUR_STROKE_CAM_SENSOR, SyncEdge::Rise);
|
||||
assertEqualsM("shape size", s->getSize(), 4);
|
||||
ASSERT_EQ(s->wave.getSwitchTime(0), 0.25);
|
||||
|
@ -451,7 +433,6 @@ TEST(trigger, testTriggerDecoder) {
|
|||
EngineTestHelper eth(MITSU_4G93);
|
||||
|
||||
|
||||
eth.persistentConfig.engineConfiguration.useOnlyRisingEdgeForTrigger = false;
|
||||
eth.persistentConfig.engineConfiguration.sensorChartMode = SC_DETAILED_RPM;
|
||||
applyNonPersistentConfiguration();
|
||||
|
||||
|
@ -467,7 +448,6 @@ TEST(trigger, testTriggerDecoder) {
|
|||
EngineTestHelper eth(DODGE_NEON_2003_CRANK);
|
||||
|
||||
printf("!!!!!!!!!!!!!!!!!! Now trying with only rising edges !!!!!!!!!!!!!!!!!\r\n");
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
applyNonPersistentConfiguration();
|
||||
prepareOutputSignals();
|
||||
|
@ -1049,7 +1029,6 @@ TEST(big, testSparkReverseOrderBug319) {
|
|||
engineConfiguration->isFasterEngineSpinUpEnabled = false;
|
||||
engine->tdcMarkEnabled = false;
|
||||
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
|
||||
engineConfiguration->isInjectionEnabled = false;
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
||||
|
@ -1153,7 +1132,6 @@ TEST(big, testMissedSpark299) {
|
|||
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
|
||||
setupSimpleTestEngineWithMafAndTT_ONE_trigger(ð);
|
||||
engineConfiguration->isIgnitionEnabled = true;
|
||||
engineConfiguration->isInjectionEnabled = false;
|
||||
|
|
|
@ -5,17 +5,12 @@ using ::testing::StrictMock;
|
|||
|
||||
class MockTriggerConfiguration : public TriggerConfiguration {
|
||||
public:
|
||||
MockTriggerConfiguration(bool useOnlyRise, trigger_config_s type)
|
||||
MockTriggerConfiguration(trigger_config_s type)
|
||||
: TriggerConfiguration("Mock")
|
||||
, m_useOnlyRise(useOnlyRise)
|
||||
, m_type(type)
|
||||
{ }
|
||||
|
||||
protected:
|
||||
bool isUseOnlyRisingEdgeForTrigger() const override {
|
||||
return m_useOnlyRise;
|
||||
}
|
||||
|
||||
bool isVerboseTriggerSynchDetails() const override {
|
||||
return false;
|
||||
}
|
||||
|
@ -25,7 +20,6 @@ protected:
|
|||
}
|
||||
|
||||
private:
|
||||
const bool m_useOnlyRise;
|
||||
const trigger_config_s m_type;
|
||||
};
|
||||
|
||||
|
@ -47,7 +41,7 @@ static auto makeTriggerShape(operation_mode_e mode, const TriggerConfiguration&
|
|||
#define doTooth(dut, shape, cfg, t) dut.decodeTriggerEvent("", shape, nullptr, cfg, SHAFT_PRIMARY_RISING, t)
|
||||
|
||||
TEST(TriggerDecoder, FindsFirstSyncPoint) {
|
||||
MockTriggerConfiguration cfg(true, {TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CAM_SENSOR, cfg);
|
||||
|
@ -90,7 +84,7 @@ TEST(TriggerDecoder, FindsFirstSyncPoint) {
|
|||
|
||||
|
||||
TEST(TriggerDecoder, FindsSyncPointMultipleRevolutions) {
|
||||
MockTriggerConfiguration cfg(true, {TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CAM_SENSOR, cfg);
|
||||
|
@ -140,7 +134,7 @@ TEST(TriggerDecoder, FindsSyncPointMultipleRevolutions) {
|
|||
}
|
||||
|
||||
TEST(TriggerDecoder, TooManyTeeth_CausesError) {
|
||||
MockTriggerConfiguration cfg(true, {TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CAM_SENSOR, cfg);
|
||||
|
@ -218,7 +212,7 @@ TEST(TriggerDecoder, TooManyTeeth_CausesError) {
|
|||
}
|
||||
|
||||
TEST(TriggerDecoder, NotEnoughTeeth_CausesError) {
|
||||
MockTriggerConfiguration cfg(true, {TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CAM_SENSOR, cfg);
|
||||
|
@ -295,7 +289,7 @@ TEST(TriggerDecoder, NotEnoughTeeth_CausesError) {
|
|||
}
|
||||
|
||||
TEST(TriggerDecoder, PrimaryDecoderNoDisambiguation) {
|
||||
MockTriggerConfiguration cfg(true, {TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CAM_SENSOR, cfg);
|
||||
|
@ -326,7 +320,7 @@ TEST(TriggerDecoder, PrimaryDecoderNoDisambiguation) {
|
|||
}
|
||||
|
||||
TEST(TriggerDecoder, PrimaryDecoderNeedsDisambiguation) {
|
||||
MockTriggerConfiguration cfg(true, {TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CRANK_SENSOR, cfg);
|
||||
|
|
|
@ -75,7 +75,6 @@ TEST(big, testTriggerInputAdc) {
|
|||
EngineTestHelper eth(TEST_ENGINE);
|
||||
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
engineConfiguration->adcVcc = 3.3f;
|
||||
engineConfiguration->analogInputDividerCoefficient = 2.0f;
|
||||
|
|
|
@ -10,9 +10,7 @@
|
|||
|
||||
// TEST(trigger, miataNA) {
|
||||
// TriggerWaveform naShape;
|
||||
// naShape.useOnlyRisingEdgeForTriggerTemp = false;
|
||||
// initializeMazdaMiataNaShape(&naShape);
|
||||
|
||||
// EngineTestHelper eth(FRANKENSO_MIATA_NA6_MAP);
|
||||
// // todo: https://github.com/rusefi/rusefi/issues/679
|
||||
// }
|
||||
|
|
|
@ -164,7 +164,6 @@ TEST(trigger, noiselessDecoder) {
|
|||
EngineTestHelper eth(TEST_ENGINE);
|
||||
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
// we'll test on 60-2 wheel
|
||||
eth.setTriggerType(TT_TOOTHED_WHEEL_60_2);
|
||||
|
|
Loading…
Reference in New Issue