auto-sync

This commit is contained in:
rusEfi 2015-10-29 14:02:52 -04:00
parent bc4e896af3
commit b021de5065
11 changed files with 32 additions and 26 deletions

View File

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

View File

@ -10,7 +10,7 @@
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->isSynchronizationNeeded = false;
@ -28,7 +28,7 @@ void initDodgeRam(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
void configureNeon2003TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
bool_t useOnlyPrimary = false;
s->reset(FOUR_STROKE_CAM_SENSOR, !useOnlyPrimary);
s->initialize(FOUR_STROKE_CAM_SENSOR, !useOnlyPrimary);
s->useRiseEdge = true;
s->gapBothDirections = false;
@ -237,7 +237,7 @@ void configureNeon2003TriggerShape(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->tdcPosition = 150;
@ -303,7 +303,7 @@ void configureDodgeStratusTriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_
}
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);

View File

@ -355,7 +355,7 @@ void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount,
s->isSynchronizationNeeded = (skippedCount != 0);
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),
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) {
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(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) {
s->reset(FOUR_STROKE_CAM_SENSOR, true);
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
int totalTeethCount = 60;
int skippedCount = 2;

View File

@ -8,7 +8,7 @@
#include "trigger_gm.h"
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
float w = 10;

View File

@ -21,7 +21,7 @@
#include "trigger_mazda.h"
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->useRiseEdge = false;
@ -51,7 +51,7 @@ void initializeMazdaMiataNbShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
s->setTriggerSynchronizationGap(0.11f);
s->useRiseEdge = false;
s->reset(FOUR_STROKE_CAM_SENSOR, true);
s->initialize(FOUR_STROKE_CAM_SENSOR, 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;
s->reset(FOUR_STROKE_CAM_SENSOR, false);
s->initialize(FOUR_STROKE_CAM_SENSOR, false);
// s->initialState[0] = 1;
// 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) {
// 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

View File

@ -9,7 +9,7 @@
void configureFordAspireTriggerShape(TriggerShape * s) {
s->isSynchronizationNeeded = false;
s->reset(FOUR_STROKE_CAM_SENSOR, true);
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
float x = 121.90;
@ -29,7 +29,7 @@ void configureFordAspireTriggerShape(TriggerShape * s) {
}
void initializeMitsubishi4g18(TriggerShape *s) {
s->reset(FOUR_STROKE_CAM_SENSOR, true);
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
s->useRiseEdge = false;
s->setTriggerSynchronizationGap(1.6666);

View File

@ -8,7 +8,7 @@
#include "trigger_nissan.h"
void initializeNissan(TriggerShape *s) {
s->reset(FOUR_STROKE_CAM_SENSOR, false);
s->initialize(FOUR_STROKE_CAM_SENSOR, false);
s->isSynchronizationNeeded = false;
float w = 5;

View File

@ -35,8 +35,8 @@ trigger_shape_helper::trigger_shape_helper() {
TriggerShape::TriggerShape() :
wave(switchTimesBuffer, NULL) {
reset(OM_NONE, false);
clear();
initialize(OM_NONE, false);
wave.waves = h.waves;
// todo: false here, true in clear() what a mess!
useRiseEdge = false;
@ -118,7 +118,7 @@ void TriggerShape::clear() {
gapBothDirections = false;
}
void TriggerShape::reset(operation_mode_e operationMode, bool needSecondTriggerInput) {
void TriggerShape::initialize(operation_mode_e operationMode, bool needSecondTriggerInput) {
this->operationMode = operationMode;
size = 0;
this->needSecondTriggerInput = needSecondTriggerInput;
@ -375,7 +375,7 @@ void setVwConfiguration(TriggerShape *s) {
s->isSynchronizationNeeded = true;
s->reset(operationMode, false);
s->initialize(operationMode, false);
int totalTeethCount = 60;
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
*/
void configureHondaAccordCDDip(TriggerShape *s) {
s->reset(FOUR_STROKE_CAM_SENSOR, true);
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
s->initialState[T_SECONDARY] = TV_HIGH;
float sb = 0;
@ -516,7 +516,7 @@ void configureHondaAccordCD(TriggerShape *s, bool withOneEventSignal, bool withF
trigger_wheel_e const oneEventWave,
trigger_wheel_e const fourEventWave,
float prefix) {
s->reset(FOUR_STROKE_CAM_SENSOR, true);
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
// trigger_wheel_e const oneEventWave = T_CHANNEL_3;
// bool withFourEventSignal = true;

View File

@ -66,7 +66,11 @@ public:
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
*/
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);
operation_mode_e getOperationMode();
// todo: these two methods here, something could be improved
/**
* This method resets
*/
void clear();
void reset(operation_mode_e operationMode, bool needSecondTriggerInput);
void initialize(operation_mode_e operationMode, bool needSecondTriggerInput);
void setTriggerSynchronizationGap(float synchRatio);
void setTriggerSynchronizationGap2(float syncRatioFrom, float syncRatioTo);
void setSecondTriggerSynchronizationGap(float synchRatio);

View File

@ -11,7 +11,7 @@
* This trigger is also used by Nissan and Mazda
*/
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 narrow = 10 * 2;

View File

@ -122,7 +122,7 @@ void testFuelMap(void) {
extern engine_configuration_s *engineConfiguration;
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(121.90, T_SECONDARY, TV_LOW);