This commit is contained in:
rusefi 2018-12-25 19:42:27 -05:00
parent dd59c8cd92
commit f49b34b794
12 changed files with 61 additions and 62 deletions

View File

@ -9,19 +9,18 @@
#include "trigger_decoder.h"
#include "trigger_universal.h"
void initDodgeRam(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
void initDodgeRam(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
s->useRiseEdge = true;
s->isSynchronizationNeeded = false;
addSkippedToothTriggerEvents(T_SECONDARY, s, 8, 0, 0.06, -25, 360, 0, 720 PASS_ENGINE_PARAMETER_SUFFIX);
addSkippedToothTriggerEvents(T_SECONDARY, s, 8, 0, 0.06, -25, 360, 0, 720);
s->addEvent720(360, T_PRIMARY, TV_RISE);
addSkippedToothTriggerEvents(T_SECONDARY, s, 8, 0, 0.06, 360 - 25, 360, 0,
720 PASS_ENGINE_PARAMETER_SUFFIX);
addSkippedToothTriggerEvents(T_SECONDARY, s, 8, 0, 0.06, 360 - 25, 360, 0, 720);
s->addEvent720(720, T_PRIMARY, TV_FALL);
s->useOnlyPrimaryForSync = true;
@ -101,7 +100,7 @@ void configureNeon2003TriggerShapeCrank(TriggerShape *s DECLARE_ENGINE_PARAMETER
s->addEvent720(m * 360, T_PRIMARY, TV_RISE);
}
void configureNeon2003TriggerShapeCam(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
void configureNeon2003TriggerShapeCam(TriggerShape *s) {
// todo: move sync point so that two channel does not have false trigger issues
bool useOnlyPrimary = true;
@ -324,7 +323,7 @@ gap=1.43/0.71
}
}
void configureDodgeStratusTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
void configureDodgeStratusTriggerShape(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, false);
s->isSynchronizationNeeded = true;
@ -390,7 +389,7 @@ void configureDodgeStratusTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_
s->addEvent720(angle + w, T_PRIMARY, TV_FALL);
}
static void configureNeon1995TriggerShapeCommon(bool withCam, TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
static void configureNeon1995TriggerShapeCommon(bool withCam, TriggerShape *s) {
trigger_wheel_e crank = withCam ? T_SECONDARY : T_PRIMARY;
// voodoo magic - we always need 720 at the end
@ -450,17 +449,17 @@ static void configureNeon1995TriggerShapeCommon(bool withCam, TriggerShape *s DE
}
}
void configureNeon1995TriggerShapeOnlyCrank(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
void configureNeon1995TriggerShapeOnlyCrank(TriggerShape *s) {
s->initialize(FOUR_STROKE_CRANK_SENSOR, false);
s->setTriggerSynchronizationGap(3.79);
s->tdcPosition = 279;
configureNeon1995TriggerShapeCommon(false, s PASS_ENGINE_PARAMETER_SUFFIX);
configureNeon1995TriggerShapeCommon(false, s);
}
void configureNeon1995TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
void configureNeon1995TriggerShape(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
s->setTriggerSynchronizationGap(0.8227);
@ -470,12 +469,12 @@ void configureNeon1995TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFF
s->initialState[T_PRIMARY] = 1;
configureNeon1995TriggerShapeCommon(true, s PASS_ENGINE_PARAMETER_SUFFIX);
configureNeon1995TriggerShapeCommon(true, s);
s->useOnlyPrimaryForSync = true;
}
void initJeep18_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
void initJeep18_2_2_2(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
s->isSynchronizationNeeded = true;
s->setTriggerSynchronizationGap(1);
@ -545,7 +544,7 @@ void initJeep18_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
}
static void add4cylblock(int off, TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
static void add4cylblock(int off, TriggerShape *s) {
s->addEvent720(114 + off, T_SECONDARY, TV_RISE);
s->addEvent720(114 + off + 2, T_SECONDARY, TV_FALL);
@ -560,7 +559,7 @@ static void add4cylblock(int off, TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFI
}
// TT_JEEP_4_CYL
void initJeep_XJ_4cyl_2500(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
void initJeep_XJ_4cyl_2500(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
s->isSynchronizationNeeded = true;
s->setTriggerSynchronizationGap(1);
@ -569,13 +568,13 @@ void initJeep_XJ_4cyl_2500(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
float offset = 124;
add4cylblock(offset - 180, s PASS_ENGINE_PARAMETER_SUFFIX);
add4cylblock(offset, s PASS_ENGINE_PARAMETER_SUFFIX);
add4cylblock(offset - 180, s);
add4cylblock(offset, s);
s->addEvent720(236 + offset, T_PRIMARY, TV_RISE); // 360
add4cylblock(offset + 180, s PASS_ENGINE_PARAMETER_SUFFIX);
add4cylblock(offset + 360, s PASS_ENGINE_PARAMETER_SUFFIX);
add4cylblock(offset + 180, s);
add4cylblock(offset + 360, s);
s->addEvent720(596 + offset, T_PRIMARY, TV_FALL); // 720

View File

@ -13,16 +13,16 @@
#define CHRYSLER_NGC4_GAP 1
#define CHRYSLER_NGC6_GAP 1.5
void configureNeon1995TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX);
void configureNeon1995TriggerShapeOnlyCrank(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX);
void configureNeon1995TriggerShape(TriggerShape *s);
void configureNeon1995TriggerShapeOnlyCrank(TriggerShape *s);
void configureNeon2003TriggerShapeCam(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX);
void configureNeon2003TriggerShapeCrank(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX);
void initDodgeRam(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX);
void configureNeon2003TriggerShapeCam(TriggerShape *s);
void configureNeon2003TriggerShapeCrank(TriggerShape *s);
void initDodgeRam(TriggerShape *s);
void configureDodgeStratusTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX);
void configureDodgeStratusTriggerShape(TriggerShape *s);
void initJeep18_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX);
void initJeep_XJ_4cyl_2500(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX);
void initJeep18_2_2_2(TriggerShape *s);
void initJeep_XJ_4cyl_2500(TriggerShape *s);
#endif /* TRIGGER_CHRYSLER_H_ */

View File

@ -7,7 +7,7 @@
#include "trigger_gm.h"
void configureGmTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
void configureGmTriggerShape(TriggerShape *s) {
s->initialize(FOUR_STROKE_CRANK_SENSOR, false);
// all angles are x2 here - so, 5 degree width is 10

View File

@ -10,7 +10,7 @@
#include "trigger_structure.h"
void configureGmTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX);
void configureGmTriggerShape(TriggerShape *s);
void initGmLS24(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX);
#endif /* TRIGGER_GM_H_ */

View File

@ -284,12 +284,12 @@ void configureOnePlus16(TriggerShape *s, operation_mode_e operationMode DECLARE_
int skippedCount = 0;
s->addEvent720(2, T_PRIMARY, TV_RISE);
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 2, 20 PASS_ENGINE_PARAMETER_SUFFIX);
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 2, 20);
s->addEvent720(20, T_PRIMARY, TV_FALL);
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 20, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 20, NO_RIGHT_FILTER);
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 360, 360, NO_LEFT_FILTER,
NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
NO_RIGHT_FILTER);
s->isSynchronizationNeeded = false;
s->useOnlyPrimaryForSync = true;

View File

@ -7,7 +7,7 @@
#include "trigger_mitsubishi.h"
void configureFordAspireTriggerShape(TriggerShape * s DECLARE_ENGINE_PARAMETER_SUFFIX) {
void configureFordAspireTriggerShape(TriggerShape * s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
s->isSynchronizationNeeded = false;

View File

@ -10,6 +10,6 @@
#include "trigger_structure.h"
void initializeMitsubishi4g18(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX);
void configureFordAspireTriggerShape(TriggerShape * s DECLARE_ENGINE_PARAMETER_SUFFIX);
void configureFordAspireTriggerShape(TriggerShape * s);
#endif /* TRIGGER_MITSUBISHI_H_ */

View File

@ -34,7 +34,7 @@ static void initializeNissanSR20VE_4_optional_360(TriggerShape *s, bool with2nd
if (with2nd) {
addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720,
left, right PASS_ENGINE_PARAMETER_SUFFIX);
left, right);
}
s->addEvent720(right, T_PRIMARY, TV_RISE);
@ -43,7 +43,7 @@ static void initializeNissanSR20VE_4_optional_360(TriggerShape *s, bool with2nd
right = base;
if (with2nd) {
addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720,
left, right PASS_ENGINE_PARAMETER_SUFFIX);
left, right);
}
s->addEvent720(right, T_PRIMARY, TV_FALL);

View File

@ -12,7 +12,7 @@ angle_t getEngineCycle(operation_mode_e operationMode) {
}
void addSkippedToothTriggerEvents(trigger_wheel_e wheel, TriggerShape *s, int totalTeethCount, int skippedCount,
float toothWidth, float offset, float engineCycle, float filterLeft, float filterRight DECLARE_ENGINE_PARAMETER_SUFFIX) {
float toothWidth, float offset, float engineCycle, float filterLeft, float filterRight) {
efiAssertVoid(CUSTOM_ERR_6586, totalTeethCount > 0, "total count");
efiAssertVoid(CUSTOM_ERR_6587, skippedCount >= 0, "skipped count");
@ -42,11 +42,11 @@ void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount,
s->isSynchronizationNeeded = (totalTeethCount > 2) && (skippedCount != 0);
addSkippedToothTriggerEvents(T_PRIMARY, s, totalTeethCount, skippedCount, 0.5, 0, getEngineCycle(operationMode),
NO_LEFT_FILTER, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
NO_LEFT_FILTER, NO_RIGHT_FILTER);
}
void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) {
void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode) {
float engineCycle = getEngineCycle(operationMode);
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
@ -61,25 +61,25 @@ void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode DECLARE
s->useOnlyPrimaryForSync = true;
}
void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) {
void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
int totalTeethCount = 60;
int skippedCount = 2;
s->addEvent720(2, T_PRIMARY, TV_RISE);
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 2, 20 PASS_ENGINE_PARAMETER_SUFFIX);
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 2, 20);
s->addEvent720(20, T_PRIMARY, TV_FALL);
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 20, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 20, NO_RIGHT_FILTER);
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 360, 360, NO_LEFT_FILTER,
NO_RIGHT_FILTER PASS_ENGINE_PARAMETER_SUFFIX);
NO_RIGHT_FILTER);
s->isSynchronizationNeeded = false;
s->useOnlyPrimaryForSync = true;
}
void configure3_1_cam(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) {
void configure3_1_cam(TriggerShape *s, operation_mode_e operationMode) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);

View File

@ -19,14 +19,14 @@
void addSkippedToothTriggerEvents(trigger_wheel_e wheel, TriggerShape *s,
int totalTeethCount, int skippedCount,
float toothWidth,
float offset, float engineCycle, float filterLeft, float filterRight DECLARE_ENGINE_PARAMETER_SUFFIX);
float offset, float engineCycle, float filterLeft, float filterRight);
void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount, int skippedCount, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX);;
void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX);
void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode);
void configure3_1_cam(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX);
void configure3_1_cam(TriggerShape *s, operation_mode_e operationMode);
void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX);
void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode);
#endif /* CONTROLLERS_TRIGGER_DECODERS_TRIGGER_UNIVERSAL_H_ */

View File

@ -23,7 +23,7 @@ void setVwConfiguration(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
float toothWidth = 0.5;
addSkippedToothTriggerEvents(T_PRIMARY, s, 60, 2, toothWidth, 0, engineCycle,
NO_LEFT_FILTER, 690 PASS_ENGINE_PARAMETER_SUFFIX);
NO_LEFT_FILTER, 690);
float angleDown = engineCycle / totalTeethCount * (totalTeethCount - skippedCount - 1 + (1 - toothWidth) );
s->addEvent3(0 + angleDown + 12, T_PRIMARY, TV_RISE, NO_LEFT_FILTER, NO_RIGHT_FILTER);

View File

@ -518,32 +518,32 @@ void TriggerShape::initializeTriggerShape(Logging *logger, bool useOnlyRisingEdg
break;
case TT_DODGE_NEON_1995:
configureNeon1995TriggerShape(this PASS_ENGINE_PARAMETER_SUFFIX);
configureNeon1995TriggerShape(this);
break;
case TT_DODGE_NEON_1995_ONLY_CRANK:
configureNeon1995TriggerShapeOnlyCrank(this PASS_ENGINE_PARAMETER_SUFFIX);
configureNeon1995TriggerShapeOnlyCrank(this);
break;
case TT_DODGE_STRATUS:
configureDodgeStratusTriggerShape(this PASS_ENGINE_PARAMETER_SUFFIX);
configureDodgeStratusTriggerShape(this);
break;
case TT_DODGE_NEON_2003_CAM:
configureNeon2003TriggerShapeCam(this PASS_ENGINE_PARAMETER_SUFFIX);
configureNeon2003TriggerShapeCam(this);
break;
case TT_DODGE_NEON_2003_CRANK:
configureNeon2003TriggerShapeCam(this PASS_ENGINE_PARAMETER_SUFFIX);
// configureNeon2003TriggerShapeCrank(triggerShape PASS_ENGINE_PARAMETER_SUFFIX);
configureNeon2003TriggerShapeCam(this);
// configureNeon2003TriggerShapeCrank(triggerShape);
break;
case TT_FORD_ASPIRE:
configureFordAspireTriggerShape(this PASS_ENGINE_PARAMETER_SUFFIX);
configureFordAspireTriggerShape(this);
break;
case TT_GM_7X:
configureGmTriggerShape(this PASS_ENGINE_PARAMETER_SUFFIX);
configureGmTriggerShape(this);
break;
case TT_MAZDA_DOHC_1_4:
@ -551,15 +551,15 @@ void TriggerShape::initializeTriggerShape(Logging *logger, bool useOnlyRisingEdg
break;
case TT_ONE_PLUS_ONE:
configureOnePlusOne(this, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX);
configureOnePlusOne(this, engineConfiguration->operationMode);
break;
case TT_3_1_CAM:
configure3_1_cam(this, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX);
configure3_1_cam(this, engineConfiguration->operationMode);
break;
case TT_ONE_PLUS_TOOTHED_WHEEL_60_2:
configureOnePlus60_2(this, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX);
configureOnePlus60_2(this, engineConfiguration->operationMode);
break;
case TT_ONE:
@ -619,15 +619,15 @@ void TriggerShape::initializeTriggerShape(Logging *logger, bool useOnlyRisingEdg
break;
case TT_DODGE_RAM:
initDodgeRam(this PASS_ENGINE_PARAMETER_SUFFIX);
initDodgeRam(this);
break;
case TT_JEEP_4_CYL:
initJeep_XJ_4cyl_2500(this PASS_ENGINE_PARAMETER_SUFFIX);
initJeep_XJ_4cyl_2500(this);
break;
case TT_JEEP_18_2_2_2:
initJeep18_2_2_2(this PASS_ENGINE_PARAMETER_SUFFIX);
initJeep18_2_2_2(this);
break;
case TT_SUBARU_7_6: