auto-sync
This commit is contained in:
parent
bc4e896af3
commit
b021de5065
|
@ -16,7 +16,7 @@ static inline float addPair(TriggerShape *s, float a, float w) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureMiniCooperTriggerShape(TriggerShape *s) {
|
void configureMiniCooperTriggerShape(TriggerShape *s) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
// s->initialState[0] = 1;
|
// s->initialState[0] = 1;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
void initDodgeRam(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
void initDodgeRam(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||||
|
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
s->useRiseEdge = true;
|
s->useRiseEdge = true;
|
||||||
|
|
||||||
s->isSynchronizationNeeded = false;
|
s->isSynchronizationNeeded = false;
|
||||||
|
@ -28,7 +28,7 @@ void initDodgeRam(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||||
void configureNeon2003TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
void configureNeon2003TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||||
bool_t useOnlyPrimary = false;
|
bool_t useOnlyPrimary = false;
|
||||||
|
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, !useOnlyPrimary);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, !useOnlyPrimary);
|
||||||
s->useRiseEdge = true;
|
s->useRiseEdge = true;
|
||||||
s->gapBothDirections = false;
|
s->gapBothDirections = false;
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ void configureNeon2003TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureDodgeStratusTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
void configureDodgeStratusTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, false);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, false);
|
||||||
s->isSynchronizationNeeded = true;
|
s->isSynchronizationNeeded = true;
|
||||||
|
|
||||||
s->tdcPosition = 150;
|
s->tdcPosition = 150;
|
||||||
|
@ -303,7 +303,7 @@ void configureDodgeStratusTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureNeon1995TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
void configureNeon1995TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
s->setTriggerSynchronizationGap(0.72);
|
s->setTriggerSynchronizationGap(0.72);
|
||||||
|
|
||||||
|
|
|
@ -355,7 +355,7 @@ void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount,
|
||||||
s->isSynchronizationNeeded = (skippedCount != 0);
|
s->isSynchronizationNeeded = (skippedCount != 0);
|
||||||
|
|
||||||
efiAssertVoid(s != NULL, "TriggerShape is NULL");
|
efiAssertVoid(s != NULL, "TriggerShape is NULL");
|
||||||
s->reset(operationMode, false);
|
s->initialize(operationMode, false);
|
||||||
|
|
||||||
addSkippedToothTriggerEvents(T_PRIMARY, s, totalTeethCount, skippedCount, 0.5, 0, getEngineCycle(operationMode),
|
addSkippedToothTriggerEvents(T_PRIMARY, s, totalTeethCount, skippedCount, 0.5, 0, getEngineCycle(operationMode),
|
||||||
NO_LEFT_FILTER, NO_RIGHT_FILTER);
|
NO_LEFT_FILTER, NO_RIGHT_FILTER);
|
||||||
|
@ -364,7 +364,7 @@ void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount,
|
||||||
static void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode) {
|
static void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode) {
|
||||||
float engineCycle = getEngineCycle(operationMode);
|
float engineCycle = getEngineCycle(operationMode);
|
||||||
|
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
s->addEvent(180, T_PRIMARY, TV_HIGH);
|
s->addEvent(180, T_PRIMARY, TV_HIGH);
|
||||||
s->addEvent(360, T_PRIMARY, TV_LOW);
|
s->addEvent(360, T_PRIMARY, TV_LOW);
|
||||||
|
@ -376,7 +376,7 @@ static void configureOnePlusOne(TriggerShape *s, operation_mode_e operationMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode) {
|
static void configureOnePlus60_2(TriggerShape *s, operation_mode_e operationMode) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
int totalTeethCount = 60;
|
int totalTeethCount = 60;
|
||||||
int skippedCount = 2;
|
int skippedCount = 2;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "trigger_gm.h"
|
#include "trigger_gm.h"
|
||||||
|
|
||||||
void configureGmTriggerShape(TriggerShape *s) {
|
void configureGmTriggerShape(TriggerShape *s) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, false);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, false);
|
||||||
|
|
||||||
// all angles are x2 here - so, 5 degree width is 10
|
// all angles are x2 here - so, 5 degree width is 10
|
||||||
float w = 10;
|
float w = 10;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "trigger_mazda.h"
|
#include "trigger_mazda.h"
|
||||||
|
|
||||||
void initializeMazdaMiataNaShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
void initializeMazdaMiataNaShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
s->setTriggerSynchronizationGap(MIATA_NA_GAP);
|
s->setTriggerSynchronizationGap(MIATA_NA_GAP);
|
||||||
s->useRiseEdge = false;
|
s->useRiseEdge = false;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ void initializeMazdaMiataNbShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||||
s->setTriggerSynchronizationGap(0.11f);
|
s->setTriggerSynchronizationGap(0.11f);
|
||||||
s->useRiseEdge = false;
|
s->useRiseEdge = false;
|
||||||
|
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
s->invertOnAdd = true;
|
s->invertOnAdd = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,7 +90,7 @@ void configureMazdaProtegeSOHC(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||||
|
|
||||||
// todo: move to into configuration definition s->needSecondTriggerInput = FALSE;
|
// todo: move to into configuration definition s->needSecondTriggerInput = FALSE;
|
||||||
|
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, false);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, false);
|
||||||
// s->initialState[0] = 1;
|
// s->initialState[0] = 1;
|
||||||
|
|
||||||
// float w = 720 / 4 * 0.215;
|
// float w = 720 / 4 * 0.215;
|
||||||
|
@ -116,7 +116,7 @@ void configureMazdaProtegeSOHC(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||||
|
|
||||||
void configureMazdaProtegeLx(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
void configureMazdaProtegeLx(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
||||||
// todo: move to into configuration definition s->needSecondTriggerInput = FALSE;
|
// todo: move to into configuration definition s->needSecondTriggerInput = FALSE;
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* based on https://svn.code.sf.net/p/rusefi/code/trunk/misc/logs/1993_escort_gt/MAIN_rfi_report_2015-02-01%2017_39.csv
|
* based on https://svn.code.sf.net/p/rusefi/code/trunk/misc/logs/1993_escort_gt/MAIN_rfi_report_2015-02-01%2017_39.csv
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
void configureFordAspireTriggerShape(TriggerShape * s) {
|
void configureFordAspireTriggerShape(TriggerShape * s) {
|
||||||
s->isSynchronizationNeeded = false;
|
s->isSynchronizationNeeded = false;
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
|
|
||||||
float x = 121.90;
|
float x = 121.90;
|
||||||
|
@ -29,7 +29,7 @@ void configureFordAspireTriggerShape(TriggerShape * s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initializeMitsubishi4g18(TriggerShape *s) {
|
void initializeMitsubishi4g18(TriggerShape *s) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
s->useRiseEdge = false;
|
s->useRiseEdge = false;
|
||||||
|
|
||||||
s->setTriggerSynchronizationGap(1.6666);
|
s->setTriggerSynchronizationGap(1.6666);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "trigger_nissan.h"
|
#include "trigger_nissan.h"
|
||||||
|
|
||||||
void initializeNissan(TriggerShape *s) {
|
void initializeNissan(TriggerShape *s) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, false);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, false);
|
||||||
s->isSynchronizationNeeded = false;
|
s->isSynchronizationNeeded = false;
|
||||||
|
|
||||||
float w = 5;
|
float w = 5;
|
||||||
|
|
|
@ -35,8 +35,8 @@ trigger_shape_helper::trigger_shape_helper() {
|
||||||
|
|
||||||
TriggerShape::TriggerShape() :
|
TriggerShape::TriggerShape() :
|
||||||
wave(switchTimesBuffer, NULL) {
|
wave(switchTimesBuffer, NULL) {
|
||||||
reset(OM_NONE, false);
|
|
||||||
clear();
|
clear();
|
||||||
|
initialize(OM_NONE, false);
|
||||||
wave.waves = h.waves;
|
wave.waves = h.waves;
|
||||||
// todo: false here, true in clear() what a mess!
|
// todo: false here, true in clear() what a mess!
|
||||||
useRiseEdge = false;
|
useRiseEdge = false;
|
||||||
|
@ -118,7 +118,7 @@ void TriggerShape::clear() {
|
||||||
gapBothDirections = false;
|
gapBothDirections = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriggerShape::reset(operation_mode_e operationMode, bool needSecondTriggerInput) {
|
void TriggerShape::initialize(operation_mode_e operationMode, bool needSecondTriggerInput) {
|
||||||
this->operationMode = operationMode;
|
this->operationMode = operationMode;
|
||||||
size = 0;
|
size = 0;
|
||||||
this->needSecondTriggerInput = needSecondTriggerInput;
|
this->needSecondTriggerInput = needSecondTriggerInput;
|
||||||
|
@ -375,7 +375,7 @@ void setVwConfiguration(TriggerShape *s) {
|
||||||
|
|
||||||
s->isSynchronizationNeeded = true;
|
s->isSynchronizationNeeded = true;
|
||||||
|
|
||||||
s->reset(operationMode, false);
|
s->initialize(operationMode, false);
|
||||||
|
|
||||||
int totalTeethCount = 60;
|
int totalTeethCount = 60;
|
||||||
int skippedCount = 2;
|
int skippedCount = 2;
|
||||||
|
@ -450,7 +450,7 @@ static float addAccordPair3(TriggerShape *s, float sb) {
|
||||||
* 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) {
|
void configureHondaAccordCDDip(TriggerShape *s) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
s->initialState[T_SECONDARY] = TV_HIGH;
|
s->initialState[T_SECONDARY] = TV_HIGH;
|
||||||
float sb = 0;
|
float sb = 0;
|
||||||
|
@ -516,7 +516,7 @@ void configureHondaAccordCD(TriggerShape *s, bool withOneEventSignal, bool withF
|
||||||
trigger_wheel_e const oneEventWave,
|
trigger_wheel_e const oneEventWave,
|
||||||
trigger_wheel_e const fourEventWave,
|
trigger_wheel_e const fourEventWave,
|
||||||
float prefix) {
|
float prefix) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
// trigger_wheel_e const oneEventWave = T_CHANNEL_3;
|
// trigger_wheel_e const oneEventWave = T_CHANNEL_3;
|
||||||
// bool withFourEventSignal = true;
|
// bool withFourEventSignal = true;
|
||||||
|
|
|
@ -66,7 +66,11 @@ public:
|
||||||
float secondSyncRatioTo;
|
float secondSyncRatioTo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* that's the angle distance from trigger event #0 and actual engine TDC
|
* Trigger indexes within trigger cycle are counted from synchronization point, and all
|
||||||
|
* engine processes are defined in angles from TDC.
|
||||||
|
*
|
||||||
|
* That's the angle distance from trigger event #0 and actual engine TDC
|
||||||
|
*
|
||||||
* see also globalTriggerAngleOffset
|
* see also globalTriggerAngleOffset
|
||||||
*/
|
*/
|
||||||
angle_t tdcPosition;
|
angle_t tdcPosition;
|
||||||
|
@ -129,9 +133,11 @@ public:
|
||||||
void addEvent(angle_t angle, trigger_wheel_e const waveIndex, trigger_value_e const stateParam, float filterLeft, float filterRight);
|
void addEvent(angle_t angle, trigger_wheel_e const waveIndex, trigger_value_e const stateParam, float filterLeft, float filterRight);
|
||||||
operation_mode_e getOperationMode();
|
operation_mode_e getOperationMode();
|
||||||
|
|
||||||
// todo: these two methods here, something could be improved
|
/**
|
||||||
|
* This method resets
|
||||||
|
*/
|
||||||
void clear();
|
void clear();
|
||||||
void reset(operation_mode_e operationMode, bool needSecondTriggerInput);
|
void initialize(operation_mode_e operationMode, bool needSecondTriggerInput);
|
||||||
void setTriggerSynchronizationGap(float synchRatio);
|
void setTriggerSynchronizationGap(float synchRatio);
|
||||||
void setTriggerSynchronizationGap2(float syncRatioFrom, float syncRatioTo);
|
void setTriggerSynchronizationGap2(float syncRatioFrom, float syncRatioTo);
|
||||||
void setSecondTriggerSynchronizationGap(float synchRatio);
|
void setSecondTriggerSynchronizationGap(float synchRatio);
|
||||||
|
|
|
@ -11,7 +11,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) {
|
void initialize36_2_2_2(TriggerShape *s) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
float wide = 30 * 2;
|
float wide = 30 * 2;
|
||||||
float narrow = 10 * 2;
|
float narrow = 10 * 2;
|
||||||
|
|
|
@ -122,7 +122,7 @@ void testFuelMap(void) {
|
||||||
extern engine_configuration_s *engineConfiguration;
|
extern engine_configuration_s *engineConfiguration;
|
||||||
|
|
||||||
static void confgiureFordAspireTriggerShape(TriggerShape * s) {
|
static void confgiureFordAspireTriggerShape(TriggerShape * s) {
|
||||||
s->reset(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
s->addEvent(53.747, T_SECONDARY, TV_HIGH);
|
s->addEvent(53.747, T_SECONDARY, TV_HIGH);
|
||||||
s->addEvent(121.90, T_SECONDARY, TV_LOW);
|
s->addEvent(121.90, T_SECONDARY, TV_LOW);
|
||||||
|
|
Loading…
Reference in New Issue