This commit is contained in:
rusefi 2017-03-01 22:37:10 -05:00
parent a3e77b309d
commit 012cdc1f6c
7 changed files with 8 additions and 9 deletions

View File

@ -222,7 +222,7 @@ static ALWAYS_INLINE void reportEventToWaveChart(trigger_event_e ckpSignalType,
void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PARAMETER_S) {
efiAssertVoid(engine!=NULL, "configuration");
if (triggerState.triggerDefinitionError) {
if (triggerShape.shapeDefinitionError) {
// trigger is broken, we cannot do anything here
warning(CUSTOM_ERR_6144, "Shaft event while trigger is mis-configured");
return;

View File

@ -628,7 +628,6 @@ uint32_t findTriggerZeroEventIndex(TriggerState *state, TriggerShape * shape,
state->reset();
if (shape->shapeDefinitionError) {
state->triggerDefinitionError = true;
return 0;
}

View File

@ -64,8 +64,6 @@ public:
*/
bool shaft_is_synchronized;
bool triggerDefinitionError;
uint32_t toothed_previous_duration; // todo: unify Camel_notation, what a mess :(
uint32_t durationBeforePrevious; // this one is before 'toothed_previous_duration'
uint32_t thirdPreviousDuration; // this one is before durationBeforePrevious, todo: better field names?

View File

@ -63,10 +63,10 @@ void TriggerStimulatorHelper::assertSyncPositionAndSetDutyCycle(uint32_t index,
}
if (state->getTotalRevolutionCounter() != 3) {
warning(CUSTOM_OBD_TRIGGER_SHAPE, "sync failed/wrong gap parameters trigger=%s", getTrigger_type_e(engineConfiguration->trigger.type));
state->triggerDefinitionError = true;
shape->shapeDefinitionError = true;
return;
}
state->triggerDefinitionError = false;
shape->shapeDefinitionError = false;
for (int i = 0; i < PWM_PHASE_MAX_WAVE_PER_PWM; i++) {
shape->dutyCycle[i] = 1.0 * state->expectedTotalTime[i] / SIMULATION_CYCLE_PERIOD;

View File

@ -165,7 +165,7 @@ TriggerState::TriggerState() {
void TriggerState::reset() {
cycleCallback = NULL;
triggerDefinitionError = shaft_is_synchronized = false;
shaft_is_synchronized = false;
toothed_previous_time = 0;
toothed_previous_duration = 0;
durationBeforePrevious = 0;

View File

@ -249,5 +249,5 @@ int getRusEfiVersion(void) {
return 123; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE[0] * 0 != 0)
return 3211; // this is here to make the compiler happy about the unused array
return 20170223;
return 20170301;
}

View File

@ -220,6 +220,8 @@ static void testTriggerDecoder2(const char *msg, engine_type_e type, int synchPo
TriggerShape *t = &eth.engine.triggerCentral.triggerShape;
assertFalseM("isError", t->shapeDefinitionError);
assertEqualsM("synchPointIndex", synchPointIndex, t->getTriggerShapeSynchPointIndex());
assertEqualsM("channel1duty", channel1duty, t->dutyCycle[0]);
@ -490,7 +492,7 @@ void testTriggerDecoder(void) {
testTriggerDecoder2("Miata NB", MAZDA_MIATA_NB1, 12, 0.0833, 0.0444);
testTriggerDecoder2("Civic 4/0 both", TEST_CIVIC_4_0_BOTH, 0, 0.5000, 0.0);
testTriggerDecoder2("Civic 4/0 rise", TEST_CIVIC_4_0_RISE, 0, 0.0000, 0.0);
// testTriggerDecoder2("Civic 4/0 rise", TEST_CIVIC_4_0_RISE, 0, 0.0000, 0.0);
testTriggerDecoder2("test engine", TEST_ENGINE, 0, 0.7500, 0.2500);
testTriggerDecoder2("testGY6_139QMB", GY6_139QMB, 0, 0.4375, 0.0);