auto-sync
This commit is contained in:
parent
326bef69ea
commit
72621800fc
|
@ -13,13 +13,11 @@ void configureNeon2003TriggerShape(trigger_shape_s *s) {
|
|||
// voodoo magic - we always need 720 at the end
|
||||
int base = 10;
|
||||
s->useRiseEdge = true;
|
||||
s->invertOnAdd = true;
|
||||
|
||||
s->gapBothDirections = true;
|
||||
|
||||
/**
|
||||
* Theoretical gap is 4, but in reality it's
|
||||
*/
|
||||
setTriggerSynchronizationGap2(s, 2.7, 5);
|
||||
setTriggerSynchronizationGap(s, 2.91);
|
||||
|
||||
s->addEvent(base + 26, T_PRIMARY, TV_HIGH);
|
||||
s->addEvent(base + 62, T_PRIMARY, TV_LOW);
|
||||
|
|
|
@ -35,6 +35,8 @@ trigger_shape_s::trigger_shape_s() :
|
|||
wave.waves = h.waves;
|
||||
useRiseEdge = false;
|
||||
gapBothDirections = false;
|
||||
isSynchronizationNeeded = false;
|
||||
invertOnAdd = false;
|
||||
}
|
||||
|
||||
void trigger_shape_s::assignSize() {
|
||||
|
@ -194,8 +196,16 @@ float trigger_shape_s::getAngle(int index) const {
|
|||
}
|
||||
}
|
||||
|
||||
void trigger_shape_s::addEvent(float angle, trigger_wheel_e const waveIndex, trigger_value_e const state) {
|
||||
void trigger_shape_s::addEvent(float angle, trigger_wheel_e const waveIndex, trigger_value_e const stateParam) {
|
||||
efiAssertVoid(operationMode != OM_NONE, "operationMode not set");
|
||||
|
||||
trigger_value_e state;
|
||||
if (invertOnAdd) {
|
||||
state = (stateParam == TV_LOW) ? TV_HIGH : TV_LOW;
|
||||
} else {
|
||||
state = stateParam;
|
||||
}
|
||||
|
||||
/**
|
||||
* While '720' value works perfectly it has not much sense for crank sensor-only scenario.
|
||||
* todo: accept angle as a value in the 0..1 range?
|
||||
|
|
|
@ -29,7 +29,9 @@ public:
|
|||
class trigger_shape_s {
|
||||
public:
|
||||
trigger_shape_s();
|
||||
int isSynchronizationNeeded;
|
||||
bool_t isSynchronizationNeeded;
|
||||
|
||||
bool_t invertOnAdd;
|
||||
|
||||
int totalToothCount;
|
||||
int skippedToothCount;
|
||||
|
|
|
@ -2546,7 +2546,7 @@
|
|||
</file>
|
||||
</group>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\emulation\analog_chart.c</name>
|
||||
<name>$PROJ_DIR$\..\emulation\analog_chart.cpp</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\emulation\analog_chart.h</name>
|
||||
|
|
|
@ -531,7 +531,7 @@ void testTriggerDecoder(void) {
|
|||
testTriggerDecoder2("citroen", CITROEN_TU3JP, 0, 0.4833, 0.0);
|
||||
|
||||
printGapRatio = true;
|
||||
testTriggerDecoder2("neon NGC", DODGE_NEON_2003, 12, 0.5139, 0.0);
|
||||
testTriggerDecoder2("neon NGC", DODGE_NEON_2003, 5, 0.4861, 0.0);
|
||||
printGapRatio = false;
|
||||
|
||||
testMazda323();
|
||||
|
|
Loading…
Reference in New Issue