all triggers should be documented way nicer #2001

This commit is contained in:
rusefillc 2020-12-04 14:00:49 -05:00
parent 6496fd5a64
commit 61925aad15
2 changed files with 20 additions and 8 deletions

View File

@ -587,23 +587,23 @@ void configureChryslerNGC_36_2_2(TriggerWaveform *s) {
float base = 0;
for (int i = 0; i < 16; i++) {
s->addEvent720(base + narrow / 2, T_PRIMARY, TV_RISE);
s->addEvent720(base + narrow, T_PRIMARY, TV_FALL);
s->addEventAngle(base + narrow / 2, T_PRIMARY, TV_RISE);
s->addEventAngle(base + narrow, T_PRIMARY, TV_FALL);
base += narrow;
}
s->addEvent720(base + narrow / 2, T_PRIMARY, TV_RISE);
s->addEventAngle(base + narrow / 2, T_PRIMARY, TV_RISE);
base += narrow / 2;
s->addEvent720(base + wide, T_PRIMARY, TV_FALL);
s->addEventAngle(base + wide, T_PRIMARY, TV_FALL);
base += wide;
for (int i = 0; i < 14; i++) {
s->addEvent720(base + narrow / 2, T_PRIMARY, TV_RISE);
s->addEvent720(base + narrow, T_PRIMARY, TV_FALL);
s->addEventAngle(base + narrow / 2, T_PRIMARY, TV_RISE);
s->addEventAngle(base + narrow, T_PRIMARY, TV_FALL);
base += narrow;
}
s->addEvent720(720 - narrow / 2, T_PRIMARY, TV_RISE);
s->addEvent720(720, T_PRIMARY, TV_FALL);
s->addEventAngle(s->getCycleDuration() - narrow / 2, T_PRIMARY, TV_RISE);
s->addEventAngle(s->getCycleDuration(), T_PRIMARY, TV_FALL);
s->useOnlyPrimaryForSync = true;
}

View File

@ -14,6 +14,10 @@
EXTERN_ENGINE;
#if EFI_UNIT_TEST
extern bool printTriggerTrace;
#endif
// this is not the only place where we have 'isUpEvent'. todo: reuse
static const bool isRisingEdge[HW_EVENT_TYPES] = { false, true, false, true, false, true };
@ -127,6 +131,14 @@ void TriggerStimulatorHelper::assertSyncPositionAndSetDutyCycle(
return;
}
shape.shapeDefinitionError = false;
#if EFI_UNIT_TEST
if (printTriggerTrace) {
printf("Happy %s revolutionCounter=%d\r\n",
getTrigger_type_e(triggerConfiguration.TriggerType),
revolutionCounter);
}
#endif /* EFI_UNIT_TEST */
for (int i = 0; i < PWM_PHASE_MAX_WAVE_PER_PWM; i++) {
shape.expectedDutyCycle[i] = 1.0 * state.expectedTotalTime[i] / SIMULATION_CYCLE_PERIOD;