This commit is contained in:
rusefi 2018-12-25 20:09:35 -05:00
parent 23de7a6d8a
commit 22734e8f39
20 changed files with 108 additions and 108 deletions

View File

@ -15,7 +15,7 @@ static inline float addPair(TriggerShape *s, float a, float w) {
return a; return a;
} }
void configureMiniCooperTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void configureMiniCooperTriggerShape(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true); s->initialize(FOUR_STROKE_CAM_SENSOR, true);
// s->initialState[0] = 1; // s->initialState[0] = 1;

View File

@ -9,6 +9,6 @@
#include "engine.h" #include "engine.h"
void configureMiniCooperTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void configureMiniCooperTriggerShape(TriggerShape *s);
#endif /* TRIGGER_BMW_H_ */ #endif /* TRIGGER_BMW_H_ */

View File

@ -39,7 +39,7 @@ void configureGmTriggerShape(TriggerShape *s) {
s->setTriggerSynchronizationGap(6); s->setTriggerSynchronizationGap(6);
} }
static int gm_tooth_pair(float startAngle, bool isLongShort, TriggerShape* s, int mult DECLARE_ENGINE_PARAMETER_SUFFIX) static int gm_tooth_pair(float startAngle, bool isLongShort, TriggerShape* s, int mult)
{ {
int window = (isLongShort ? 12 : 3) * mult; int window = (isLongShort ? 12 : 3) * mult;
int end = startAngle + mult * 15; int end = startAngle + mult * 15;
@ -59,7 +59,7 @@ static int gm_tooth_pair(float startAngle, bool isLongShort, TriggerShape* s, in
* *
* based on data in https://rusefi.com/forum/viewtopic.php?f=3&t=936&p=30303#p30285 * based on data in https://rusefi.com/forum/viewtopic.php?f=3&t=936&p=30303#p30285
*/ */
void initGmLS24(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void initGmLS24(TriggerShape *s) {
s->initialize(FOUR_STROKE_CRANK_SENSOR, false); s->initialize(FOUR_STROKE_CRANK_SENSOR, false);
trigger_wheel_e ch = T_PRIMARY; trigger_wheel_e ch = T_PRIMARY;
@ -99,7 +99,7 @@ void initGmLS24(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
bool bit = code & 0x000001; bool bit = code & 0x000001;
code = code >> 1; code = code >> 1;
angle = gm_tooth_pair(angle, bit, s, CRANK_MODE_MULTIPLIER PASS_ENGINE_PARAMETER_SUFFIX); angle = gm_tooth_pair(angle, bit, s, CRANK_MODE_MULTIPLIER);
} }
s->useOnlyPrimaryForSync = true; s->useOnlyPrimaryForSync = true;

View File

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

View File

@ -10,7 +10,7 @@
#define S24 (720.0f / 24 / 2) #define S24 (720.0f / 24 / 2)
static float addAccordPair(TriggerShape *s, float sb, trigger_wheel_e const channelIndex DECLARE_ENGINE_PARAMETER_SUFFIX) { static float addAccordPair(TriggerShape *s, float sb, trigger_wheel_e const channelIndex) {
s->addEvent720(sb, channelIndex, TV_RISE); s->addEvent720(sb, channelIndex, TV_RISE);
sb += S24; sb += S24;
s->addEvent720(sb, channelIndex, TV_FALL); s->addEvent720(sb, channelIndex, TV_FALL);
@ -20,7 +20,7 @@ static float addAccordPair(TriggerShape *s, float sb, trigger_wheel_e const chan
} }
#define DIP 7.5f #define DIP 7.5f
static float addAccordPair3(TriggerShape *s, float sb DECLARE_ENGINE_PARAMETER_SUFFIX) { static float addAccordPair3(TriggerShape *s, float sb) {
sb += DIP; sb += DIP;
s->addEvent720(sb, T_CHANNEL_3, TV_RISE); s->addEvent720(sb, T_CHANNEL_3, TV_RISE);
sb += DIP; sb += DIP;
@ -33,58 +33,58 @@ static float addAccordPair3(TriggerShape *s, float sb DECLARE_ENGINE_PARAMETER_S
* Thank you Dip! * Thank you Dip!
* http://forum.pgmfi.org/viewtopic.php?f=2&t=15570start=210#p139007 * http://forum.pgmfi.org/viewtopic.php?f=2&t=15570start=210#p139007
*/ */
void configureHondaAccordCDDip(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void configureHondaAccordCDDip(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true); s->initialize(FOUR_STROKE_CAM_SENSOR, true);
s->initialState[T_SECONDARY] = TV_RISE; s->initialState[T_SECONDARY] = TV_RISE;
float sb = 0; float sb = 0;
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
s->addEvent720(90, T_SECONDARY, TV_FALL); s->addEvent720(90, T_SECONDARY, TV_FALL);
sb = 90; sb = 90;
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
s->addEvent720(180, T_SECONDARY, TV_RISE); s->addEvent720(180, T_SECONDARY, TV_RISE);
sb = 180; sb = 180;
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
s->addEvent720(270, T_SECONDARY, TV_FALL); s->addEvent720(270, T_SECONDARY, TV_FALL);
sb = 270; sb = 270;
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
s->addEvent720(360.0f - DIP, T_PRIMARY, TV_RISE); s->addEvent720(360.0f - DIP, T_PRIMARY, TV_RISE);
s->addEvent720(360, T_SECONDARY, TV_RISE); s->addEvent720(360, T_SECONDARY, TV_RISE);
sb = 360; sb = 360;
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
s->addEvent720(450, T_SECONDARY, TV_FALL); s->addEvent720(450, T_SECONDARY, TV_FALL);
sb = 450; sb = 450;
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
s->addEvent720(540, T_SECONDARY, TV_RISE); s->addEvent720(540, T_SECONDARY, TV_RISE);
sb = 540; sb = 540;
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
s->addEvent720(630, T_SECONDARY, TV_FALL); s->addEvent720(630, T_SECONDARY, TV_FALL);
sb = 630; sb = 630;
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair3(s, sb);
s->addEvent720(720.0f - DIP, T_PRIMARY, TV_FALL); s->addEvent720(720.0f - DIP, T_PRIMARY, TV_FALL);
@ -105,7 +105,7 @@ void configureHondaAccordCDDip(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX)
void configureHonda_1_4_24(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal, void configureHonda_1_4_24(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal,
trigger_wheel_e const oneEventWave, trigger_wheel_e const oneEventWave,
trigger_wheel_e const fourEventWave, trigger_wheel_e const fourEventWave,
float prefix DECLARE_ENGINE_PARAMETER_SUFFIX) { float prefix) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true); s->initialize(FOUR_STROKE_CAM_SENSOR, true);
@ -115,50 +115,50 @@ void configureHonda_1_4_24(TriggerShape *s, bool withOneEventSignal, bool withFo
s->isSynchronizationNeeded = false; s->isSynchronizationNeeded = false;
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
if (withOneEventSignal) if (withOneEventSignal)
s->addEvent720(sb - S24 / 2, oneEventWave, TV_RISE); s->addEvent720(sb - S24 / 2, oneEventWave, TV_RISE);
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
if (withOneEventSignal) if (withOneEventSignal)
s->addEvent720(sb - S24 / 2, oneEventWave, TV_FALL); s->addEvent720(sb - S24 / 2, oneEventWave, TV_FALL);
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) { if (withFourEventSignal) {
s->addEvent720(1 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE); s->addEvent720(1 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
} }
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) { if (withFourEventSignal) {
s->addEvent720(1 * 180.0f + prefix, fourEventWave, TV_FALL); s->addEvent720(1 * 180.0f + prefix, fourEventWave, TV_FALL);
} }
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb,T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb,T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) { if (withFourEventSignal) {
s->addEvent720(2 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE); s->addEvent720(2 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
} }
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) { if (withFourEventSignal) {
s->addEvent720(2 * 180.0f + prefix, fourEventWave, TV_FALL); s->addEvent720(2 * 180.0f + prefix, fourEventWave, TV_FALL);
} }
for (int i = 3; i <= 4; i++) { for (int i = 3; i <= 4; i++) {
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) { if (withFourEventSignal) {
s->addEvent720(i * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE); s->addEvent720(i * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
} }
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) { if (withFourEventSignal) {
s->addEvent720(i * 180.0f + prefix, fourEventWave, TV_FALL); s->addEvent720(i * 180.0f + prefix, fourEventWave, TV_FALL);
} }
@ -166,13 +166,13 @@ void configureHonda_1_4_24(TriggerShape *s, bool withOneEventSignal, bool withFo
s->useOnlyPrimaryForSync = true; s->useOnlyPrimaryForSync = true;
} }
void configureHondaCbr600(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void configureHondaCbr600(TriggerShape *s) {
// todo: finish this // todo: finish this
setToothedWheelConfiguration(s, 24, 0, FOUR_STROKE_CRANK_SENSOR PASS_ENGINE_PARAMETER_SUFFIX); setToothedWheelConfiguration(s, 24, 0, FOUR_STROKE_CRANK_SENSOR);
} }
void configureHondaCbr600custom(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void configureHondaCbr600custom(TriggerShape *s) {
float w = 720 / 2 / 24; float w = 720 / 2 / 24;
// s->initialize(FOUR_STROKE_CAM_SENSOR, false); // s->initialize(FOUR_STROKE_CAM_SENSOR, false);
@ -245,7 +245,7 @@ void configureHondaCbr600custom(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX)
} }
void configureHondaAccordShifted(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void configureHondaAccordShifted(TriggerShape *s) {
float w = 720 / 2 / 24; float w = 720 / 2 / 24;
s->initialize(FOUR_STROKE_CAM_SENSOR, true); s->initialize(FOUR_STROKE_CAM_SENSOR, true);
@ -268,7 +268,7 @@ void configureHondaAccordShifted(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX
for (int i = 0;i<23;i++) { for (int i = 0;i<23;i++) {
sb = addAccordPair(s, sb, T_SECONDARY PASS_ENGINE_PARAMETER_SUFFIX); sb = addAccordPair(s, sb, T_SECONDARY);
} }
@ -277,7 +277,7 @@ void configureHondaAccordShifted(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX
s->isSynchronizationNeeded = false; s->isSynchronizationNeeded = false;
} }
void configureOnePlus16(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) { void configureOnePlus16(TriggerShape *s, operation_mode_e operationMode) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true); s->initialize(FOUR_STROKE_CAM_SENSOR, true);
int totalTeethCount = 16; int totalTeethCount = 16;

View File

@ -10,17 +10,17 @@
#include "trigger_structure.h" #include "trigger_structure.h"
void configureHondaAccordCDDip(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void configureHondaAccordCDDip(TriggerShape *s);
void configureHondaAccordShifted(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void configureHondaAccordShifted(TriggerShape *s);
void configureHonda_1_4_24(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal, void configureHonda_1_4_24(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal,
trigger_wheel_e const oneEventWave, trigger_wheel_e const oneEventWave,
trigger_wheel_e const fourEventWave, trigger_wheel_e const fourEventWave,
float d DECLARE_ENGINE_PARAMETER_SUFFIX); float d);
void configureOnePlus16(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX); void configureOnePlus16(TriggerShape *s, operation_mode_e operationMode);
void configureHondaCbr600(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void configureHondaCbr600(TriggerShape *s);
void configureHondaCbr600custom(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void configureHondaCbr600custom(TriggerShape *s);
#endif /* CONTROLLERS_TRIGGER_TRIGGER_HONDA_H_ */ #endif /* CONTROLLERS_TRIGGER_TRIGGER_HONDA_H_ */

View File

@ -13,7 +13,7 @@
/** /**
* 8,2,2,2 Nissan pattern * 8,2,2,2 Nissan pattern
*/ */
static void initializeNissanSR20VE_4_optional_360(TriggerShape *s, bool with2nd DECLARE_ENGINE_PARAMETER_SUFFIX) { static void initializeNissanSR20VE_4_optional_360(TriggerShape *s, bool with2nd) {
s->initialize(FOUR_STROKE_CAM_SENSOR, with2nd); s->initialize(FOUR_STROKE_CAM_SENSOR, with2nd);
s->isSynchronizationNeeded = true; s->isSynchronizationNeeded = true;
s->gapBothDirections = true; s->gapBothDirections = true;
@ -99,10 +99,10 @@ static void initializeNissanSR20VE_4_optional_360(TriggerShape *s, bool with2nd
* Nissan Primera p11 year 1995-2002 * Nissan Primera p11 year 1995-2002
*/ */
void initializeNissanSR20VE_4(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void initializeNissanSR20VE_4(TriggerShape *s) {
initializeNissanSR20VE_4_optional_360(s, false PASS_ENGINE_PARAMETER_SUFFIX); initializeNissanSR20VE_4_optional_360(s, false);
} }
void initializeNissanSR20VE_4_360(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void initializeNissanSR20VE_4_360(TriggerShape *s) {
initializeNissanSR20VE_4_optional_360(s, true PASS_ENGINE_PARAMETER_SUFFIX); initializeNissanSR20VE_4_optional_360(s, true);
} }

View File

@ -10,7 +10,7 @@
#include "trigger_structure.h" #include "trigger_structure.h"
void initializeNissanSR20VE_4(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void initializeNissanSR20VE_4(TriggerShape *s);
void initializeNissanSR20VE_4_360(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void initializeNissanSR20VE_4_360(TriggerShape *s);
#endif /* CONTROLLERS_TRIGGER_TRIGGER_NISSAN_H_ */ #endif /* CONTROLLERS_TRIGGER_TRIGGER_NISSAN_H_ */

View File

@ -11,7 +11,7 @@
/** /**
* https://en.wikipedia.org/wiki/Rover_K-series_engine * https://en.wikipedia.org/wiki/Rover_K-series_engine
*/ */
void initializeRoverK(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void initializeRoverK(TriggerShape *s) {
s->initialize(FOUR_STROKE_CRANK_SENSOR, false); s->initialize(FOUR_STROKE_CRANK_SENSOR, false);
float tooth = 20; float tooth = 20;

View File

@ -11,6 +11,6 @@
#include "trigger_structure.h" #include "trigger_structure.h"
void initializeRoverK(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void initializeRoverK(TriggerShape *s);
#endif /* CONTROLLERS_TRIGGER_TRIGGER_ROVER_H_ */ #endif /* CONTROLLERS_TRIGGER_TRIGGER_ROVER_H_ */

View File

@ -10,7 +10,7 @@
/** /**
* This trigger is also used by Nissan and Mazda * This trigger is also used by Nissan and Mazda
*/ */
void initialize36_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void initialize36_2_2_2(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true); s->initialize(FOUR_STROKE_CAM_SENSOR, true);
float wide = 30 * 2; float wide = 30 * 2;
@ -46,7 +46,7 @@ void initialize36_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
s->useOnlyPrimaryForSync = true; s->useOnlyPrimaryForSync = true;
} }
void initializeSubaru7_6(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void initializeSubaru7_6(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true); s->initialize(FOUR_STROKE_CAM_SENSOR, true);
float magic = 333; float magic = 333;

View File

@ -10,7 +10,7 @@
#include "engine.h" #include "engine.h"
void initialize36_2_2_2(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void initialize36_2_2_2(TriggerShape *s);
void initializeSubaru7_6(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void initializeSubaru7_6(TriggerShape *s);
#endif /* CONTROLLERS_TRIGGER_TRIGGER_SUBARU_H_ */ #endif /* CONTROLLERS_TRIGGER_TRIGGER_SUBARU_H_ */

View File

@ -11,7 +11,7 @@
EXTERN_ENGINE; EXTERN_ENGINE;
void initialize2jzGE1_12(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void initialize2jzGE1_12(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true); s->initialize(FOUR_STROKE_CAM_SENSOR, true);
float crankD = 360 / 12 / 2; // 15 float crankD = 360 / 12 / 2; // 15
@ -45,8 +45,8 @@ void initialize2jzGE1_12(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) {
s->isSynchronizationNeeded = false; s->isSynchronizationNeeded = false;
} }
void initialize2jzGE3_34(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX) { void initialize2jzGE3_34(TriggerShape *s) {
setToothedWheelConfiguration(s, 36, 2, FOUR_STROKE_CRANK_SENSOR PASS_ENGINE_PARAMETER_SUFFIX); setToothedWheelConfiguration(s, 36, 2, FOUR_STROKE_CRANK_SENSOR);
// s->initialize(FOUR_STROKE_CAM_SENSOR, true); // s->initialize(FOUR_STROKE_CAM_SENSOR, true);
// //

View File

@ -10,7 +10,7 @@
#include "engine.h" #include "engine.h"
void initialize2jzGE1_12(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void initialize2jzGE1_12(TriggerShape *s);
void initialize2jzGE3_34(TriggerShape *s DECLARE_ENGINE_PARAMETER_SUFFIX); void initialize2jzGE3_34(TriggerShape *s);
#endif /* CONTROLLERS_TRIGGER_TRIGGER_TOYOTA_H_ */ #endif /* CONTROLLERS_TRIGGER_TRIGGER_TOYOTA_H_ */

View File

@ -29,7 +29,7 @@ void addSkippedToothTriggerEvents(trigger_wheel_e wheel, TriggerShape *s, int to
} }
void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount, int skippedCount, void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount, int skippedCount,
operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) { operation_mode_e operationMode) {
if (totalTeethCount <= 0) { if (totalTeethCount <= 0) {
warning(CUSTOM_OBD_TRIGGER_SHAPE, "totalTeethCount is zero or less: %d", totalTeethCount); warning(CUSTOM_OBD_TRIGGER_SHAPE, "totalTeethCount is zero or less: %d", totalTeethCount);
s->shapeDefinitionError = true; s->shapeDefinitionError = true;

View File

@ -22,7 +22,7 @@ void addSkippedToothTriggerEvents(trigger_wheel_e wheel, TriggerShape *s,
float offset, float engineCycle, float filterLeft, float filterRight); 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 initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount, int skippedCount, operation_mode_e operationMode);;
void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode); void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode);

View File

@ -494,7 +494,7 @@ void TriggerShape::initializeTriggerShape(Logging *logger, bool useOnlyRisingEdg
case TT_TOOTHED_WHEEL: case TT_TOOTHED_WHEEL:
initializeSkippedToothTriggerShapeExt(this, triggerConfig->customTotalToothCount, initializeSkippedToothTriggerShapeExt(this, triggerConfig->customTotalToothCount,
triggerConfig->customSkippedToothCount, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX); triggerConfig->customSkippedToothCount, engineConfiguration->operationMode);
break; break;
case TT_MAZDA_MIATA_NA: case TT_MAZDA_MIATA_NA:
@ -563,7 +563,7 @@ void TriggerShape::initializeTriggerShape(Logging *logger, bool useOnlyRisingEdg
break; break;
case TT_ONE: case TT_ONE:
setToothedWheelConfiguration(this, 1, 0, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX); setToothedWheelConfiguration(this, 1, 0, engineConfiguration->operationMode);
break; break;
case TT_MAZDA_SOHC_4: case TT_MAZDA_SOHC_4:
@ -571,11 +571,11 @@ void TriggerShape::initializeTriggerShape(Logging *logger, bool useOnlyRisingEdg
break; break;
case TT_MINI_COOPER_R50: case TT_MINI_COOPER_R50:
configureMiniCooperTriggerShape(this PASS_ENGINE_PARAMETER_SUFFIX); configureMiniCooperTriggerShape(this);
break; break;
case TT_TOOTHED_WHEEL_60_2: case TT_TOOTHED_WHEEL_60_2:
setToothedWheelConfiguration(this, 60, 2, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX); setToothedWheelConfiguration(this, 60, 2, engineConfiguration->operationMode);
break; break;
case TT_60_2_VW: case TT_60_2_VW:
@ -583,35 +583,35 @@ void TriggerShape::initializeTriggerShape(Logging *logger, bool useOnlyRisingEdg
break; break;
case TT_TOOTHED_WHEEL_36_1: case TT_TOOTHED_WHEEL_36_1:
setToothedWheelConfiguration(this, 36, 1, engineConfiguration->operationMode PASS_ENGINE_PARAMETER_SUFFIX); setToothedWheelConfiguration(this, 36, 1, engineConfiguration->operationMode);
break; break;
case TT_HONDA_4_24_1: case TT_HONDA_4_24_1:
configureHonda_1_4_24(this, true, true, T_CHANNEL_3, T_PRIMARY, 0 PASS_ENGINE_PARAMETER_SUFFIX); configureHonda_1_4_24(this, true, true, T_CHANNEL_3, T_PRIMARY, 0);
break; break;
case TT_HONDA_4_24: case TT_HONDA_4_24:
configureHonda_1_4_24(this, false, true, T_NONE, T_PRIMARY, 0 PASS_ENGINE_PARAMETER_SUFFIX); configureHonda_1_4_24(this, false, true, T_NONE, T_PRIMARY, 0);
break; break;
case TT_HONDA_1_24: case TT_HONDA_1_24:
configureHonda_1_4_24(this, true, false, T_PRIMARY, T_NONE, 10 PASS_ENGINE_PARAMETER_SUFFIX); configureHonda_1_4_24(this, true, false, T_PRIMARY, T_NONE, 10);
break; break;
case TT_HONDA_ACCORD_1_24_SHIFTED: case TT_HONDA_ACCORD_1_24_SHIFTED:
configureHondaAccordShifted(this PASS_ENGINE_PARAMETER_SUFFIX); configureHondaAccordShifted(this);
break; break;
case TT_HONDA_1_4_24: case TT_HONDA_1_4_24:
configureHondaAccordCDDip(this PASS_ENGINE_PARAMETER_SUFFIX); configureHondaAccordCDDip(this);
break; break;
case TT_HONDA_CBR_600: case TT_HONDA_CBR_600:
configureHondaCbr600(this PASS_ENGINE_PARAMETER_SUFFIX); configureHondaCbr600(this);
break; break;
case TT_HONDA_CBR_600_CUSTOM: case TT_HONDA_CBR_600_CUSTOM:
configureHondaCbr600custom(this PASS_ENGINE_PARAMETER_SUFFIX); configureHondaCbr600custom(this);
break; break;
case TT_MITSUBISHI: case TT_MITSUBISHI:
@ -631,31 +631,31 @@ void TriggerShape::initializeTriggerShape(Logging *logger, bool useOnlyRisingEdg
break; break;
case TT_SUBARU_7_6: case TT_SUBARU_7_6:
initializeSubaru7_6(this PASS_ENGINE_PARAMETER_SUFFIX); initializeSubaru7_6(this);
break; break;
case TT_36_2_2_2: case TT_36_2_2_2:
initialize36_2_2_2(this PASS_ENGINE_PARAMETER_SUFFIX); initialize36_2_2_2(this);
break; break;
case TT_2JZ_3_34: case TT_2JZ_3_34:
initialize2jzGE3_34(this PASS_ENGINE_PARAMETER_SUFFIX); initialize2jzGE3_34(this);
break; break;
case TT_2JZ_1_12: case TT_2JZ_1_12:
initialize2jzGE1_12(this PASS_ENGINE_PARAMETER_SUFFIX); initialize2jzGE1_12(this);
break; break;
case TT_NISSAN_SR20VE: case TT_NISSAN_SR20VE:
initializeNissanSR20VE_4(this PASS_ENGINE_PARAMETER_SUFFIX); initializeNissanSR20VE_4(this);
break; break;
case TT_NISSAN_SR20VE_360: case TT_NISSAN_SR20VE_360:
initializeNissanSR20VE_4_360(this PASS_ENGINE_PARAMETER_SUFFIX); initializeNissanSR20VE_4_360(this);
break; break;
case TT_ROVER_K: case TT_ROVER_K:
initializeRoverK(this PASS_ENGINE_PARAMETER_SUFFIX); initializeRoverK(this);
break; break;
case TT_FIAT_IAW_P8: case TT_FIAT_IAW_P8:
@ -663,7 +663,7 @@ void TriggerShape::initializeTriggerShape(Logging *logger, bool useOnlyRisingEdg
break; break;
case TT_GM_LS_24: case TT_GM_LS_24:
initGmLS24(this PASS_ENGINE_PARAMETER_SUFFIX); initGmLS24(this);
break; break;
default: default:

View File

@ -418,13 +418,13 @@ angle_t TriggerShape::getSwitchAngle(int index) const {
} }
void setToothedWheelConfiguration(TriggerShape *s, int total, int skipped, void setToothedWheelConfiguration(TriggerShape *s, int total, int skipped,
operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX) { operation_mode_e operationMode) {
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__) #if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
s->useRiseEdge = true; s->useRiseEdge = true;
initializeSkippedToothTriggerShapeExt(s, total, skipped, initializeSkippedToothTriggerShapeExt(s, total, skipped,
operationMode PASS_ENGINE_PARAMETER_SUFFIX); operationMode);
#endif #endif
} }

View File

@ -250,7 +250,7 @@ private:
void calculateTriggerSynchPoint(TriggerState *state DECLARE_ENGINE_PARAMETER_SUFFIX); void calculateTriggerSynchPoint(TriggerState *state DECLARE_ENGINE_PARAMETER_SUFFIX);
}; };
void setToothedWheelConfiguration(TriggerShape *s, int total, int skipped, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_SUFFIX); void setToothedWheelConfiguration(TriggerShape *s, int total, int skipped, operation_mode_e operationMode);
#define TRIGGER_SHAPE(x) ENGINE(triggerCentral.triggerShape.x) #define TRIGGER_SHAPE(x) ENGINE(triggerCentral.triggerShape.x)

View File

@ -469,7 +469,7 @@ void testTriggerDecoder(void) {
engine_configuration_s *engineConfiguration = &c.engineConfiguration; engine_configuration_s *engineConfiguration = &c.engineConfiguration;
board_configuration_s *boardConfiguration = &c.engineConfiguration.bc; board_configuration_s *boardConfiguration = &c.engineConfiguration.bc;
initializeSkippedToothTriggerShapeExt(s, 2, 0, FOUR_STROKE_CAM_SENSOR PASS_ENGINE_PARAMETER_SUFFIX); initializeSkippedToothTriggerShapeExt(s, 2, 0, FOUR_STROKE_CAM_SENSOR);
assertEqualsM("shape size", s->getSize(), 4); assertEqualsM("shape size", s->getSize(), 4);
assertEquals(s->wave.switchTimes[0], 0.25); assertEquals(s->wave.switchTimes[0], 0.25);
assertEquals(s->wave.switchTimes[1], 0.5); assertEquals(s->wave.switchTimes[1], 0.5);