Trigger setup in TS is highly confusing: hide operation mode from users? #4031
This commit is contained in:
parent
a43aec4e60
commit
95d36b37e3
|
@ -150,7 +150,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -171,7 +171,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "trigger_input.h"
|
||||
|
||||
void setBoardDefaultConfiguration() {
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
|
|
@ -151,7 +151,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -130,7 +130,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -142,7 +142,7 @@ void setBoardDefaultConfiguration() {
|
|||
engineConfiguration->etb_use_two_wires = true;
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
|
||||
engineConfiguration->vvtCamSensorUseRise = true;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
|
|
@ -161,7 +161,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -192,7 +192,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -160,7 +160,7 @@ void setBoardDefaultConfiguration() {
|
|||
engineConfiguration->etbFunctions[1] = ETB_Wastegate;
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
|
||||
engineConfiguration->vvtCamSensorUseRise = true;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
|
|
@ -140,7 +140,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -146,7 +146,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -151,7 +151,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -139,7 +139,7 @@ void setBoardDefaultConfiguration() {
|
|||
engineConfiguration->etb_use_two_wires = true;
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
|
||||
engineConfiguration->vvtCamSensorUseRise = true;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
|
|
@ -140,7 +140,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -15,7 +15,7 @@ int __debugEnabled = 0;
|
|||
#endif
|
||||
|
||||
void setBoardOverrides() {
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -186,7 +186,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -200,7 +200,7 @@ void setBoardDefaultConfiguration() {
|
|||
setupDefaultSensorInputs();
|
||||
|
||||
// Some sensible defaults for other options
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
|
|
@ -27,7 +27,7 @@ void setGy6139qmbDefaultEngineConfiguration() {
|
|||
engineConfiguration->globalTriggerAngleOffset = 45;
|
||||
engineConfiguration->specs.displacement = 0.072; // 72cc
|
||||
engineConfiguration->specs.cylindersCount = 1;
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
// this is related to 'setDefaultBaseEngine' having 'skippedWheelOnCam = true' which is a weird fact by itself
|
||||
engineConfiguration->skippedWheelOnCam = false;
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ void m73engine() {
|
|||
engineConfiguration->vvtMode[0] = VVT_FIRST_HALF;
|
||||
|
||||
engineConfiguration->globalTriggerAngleOffset = 90;
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
// todo: that's not right, should be 60/2 without VW
|
||||
engineConfiguration->trigger.type = TT_60_2_VW;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ void setCamaro4() {
|
|||
// set ignition_mode 2
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_GM_LS_24;
|
||||
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_0; // PA0
|
||||
|
|
|
@ -20,7 +20,7 @@ void setCitroenBerlingoTU3JPConfiguration() {
|
|||
/**
|
||||
* Base engine setting
|
||||
*/
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->globalTriggerAngleOffset = 114;
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
|
|
|
@ -257,7 +257,7 @@ void setEtbTestConfiguration() {
|
|||
// yes, 30K - that's a test configuration
|
||||
engineConfiguration->rpmHardLimit = 30000;
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
|
||||
|
||||
|
|
|
@ -54,14 +54,14 @@ void setTestCrankEngineConfiguration() {
|
|||
|
||||
engineConfiguration->trigger.type = TT_ONE;
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
// this is related to 'setDefaultBaseEngine' having 'skippedWheelOnCam = true' which is a weird fact by itself
|
||||
engineConfiguration->skippedWheelOnCam = false;
|
||||
}
|
||||
|
||||
void setTestVVTEngineConfiguration() {
|
||||
setDefaultFrankensoConfiguration();
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
engineConfiguration->trigger.customTotalToothCount = 3;
|
||||
|
|
|
@ -74,7 +74,7 @@ void setToyota_jzs147EngineConfiguration() {
|
|||
engineConfiguration->trigger.type = TT_2JZ_1_12;
|
||||
|
||||
//// temporary while I am fixing trigger bug
|
||||
// setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
// setCrankOperationMode(engineConfiguration);
|
||||
// //set trigger_type 16
|
||||
// engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
// engineConfiguration->trigger.customTotalToothCount = 36;
|
||||
|
@ -102,7 +102,7 @@ void setToyota_jzs147EngineConfiguration() {
|
|||
void setToyota_2jz_vics() {
|
||||
common2jz();
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_2;
|
||||
|
||||
engineConfiguration->triggerInputPins[0] = GPIOA_5; // crank sensor
|
||||
|
|
|
@ -25,7 +25,7 @@ void setVwAba() {
|
|||
engineConfiguration->globalTriggerAngleOffset = 93;
|
||||
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*/
|
||||
void setVwPassatB6() {
|
||||
#if HW_MICRO_RUSEFI
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->vvtMode[0] = VVT_BOSCH_QUICK_START;
|
||||
engineConfiguration->map.sensor.type = MT_BOSCH_2_5;
|
||||
|
|
|
@ -1178,6 +1178,10 @@ void setOperationMode(engine_configuration_s *engineConfiguration, operation_mod
|
|||
engineConfiguration->ambiguousOperationMode = mode;
|
||||
}
|
||||
|
||||
void setCrankOperationMode(engine_configuration_s *engineConfiguration) {
|
||||
engineConfiguration->ambiguousOperationMode = FOUR_STROKE_CRANK_SENSOR;
|
||||
}
|
||||
|
||||
void commonFrankensoAnalogInputs(engine_configuration_s *engineConfiguration) {
|
||||
/**
|
||||
* VBatt
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define MOCK_UNDEFINED -1
|
||||
|
||||
void setOperationMode(engine_configuration_s *engineConfiguration, operation_mode_e mode);
|
||||
void setCrankOperationMode(engine_configuration_s *engineConfiguration);
|
||||
|
||||
void prepareVoidConfiguration(engine_configuration_s *activeConfiguration);
|
||||
void setTargetRpmCurve(int rpm);
|
||||
|
|
|
@ -64,7 +64,7 @@ TEST(fuel, testWallWettingEnrichmentScheduling) {
|
|||
|
||||
EngineTestHelper eth(FORD_ASPIRE_1996);
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
eth.setTriggerType(TT_ONE);
|
||||
|
|
|
@ -12,7 +12,7 @@ TEST(issues, issueOneCylinderSpecialCase968) {
|
|||
// set injection_mode 1
|
||||
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
eth.setTriggerType(TT_ONE);
|
||||
|
|
|
@ -42,7 +42,7 @@ TEST(fuel, testTpsAccelEnrichmentMath) {
|
|||
TEST(fuel, testTpsAccelEnrichmentScheduling) {
|
||||
EngineTestHelper eth(FORD_ASPIRE_1996);
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
engineConfiguration->tpsAccelEnrichmentThreshold = 5;
|
||||
|
|
|
@ -84,7 +84,7 @@ TEST(trigger, testCamInput) {
|
|||
EngineTestHelper eth(FORD_ESCORT_GT);
|
||||
|
||||
// changing to 'ONE TOOTH' trigger on CRANK with CAM/VVT
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
engineConfiguration->vvtMode[0] = VVT_FIRST_HALF;
|
||||
engineConfiguration->vvtOffsets[0] = 360;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "pch.h"
|
||||
|
||||
static void boardConfigurationForIssue898(engine_configuration_s *engineConfiguration) {
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ TEST(trigger, testQuadCam) {
|
|||
// setting some weird engine
|
||||
EngineTestHelper eth(FORD_ESCORT_GT);
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
setCrankOperationMode(engineConfiguration);
|
||||
|
||||
// changing to 'ONE TOOTH' trigger on CRANK with CAM/VVT
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
|
Loading…
Reference in New Issue