minor trigger refactoring

This commit is contained in:
rusefillc 2022-11-06 01:32:59 -04:00
parent d5c2c0294b
commit d23b0b063f
1 changed files with 7 additions and 5 deletions

View File

@ -966,15 +966,15 @@ void TriggerCentral::validateCamVvtCounters() {
* Calculate 'shape.triggerShapeSynchPointIndex' value using 'TriggerDecoderBase *state' * Calculate 'shape.triggerShapeSynchPointIndex' value using 'TriggerDecoderBase *state'
*/ */
static void calculateTriggerSynchPoint( static void calculateTriggerSynchPoint(
TriggerCentral *triggerCentral, const PrimaryTriggerConfiguration &primaryTriggerConfiguration,
TriggerWaveform& shape, TriggerWaveform& shape,
TriggerDecoderBase& state) { TriggerDecoderBase& initState) {
#if EFI_PROD_CODE #if EFI_PROD_CODE
efiAssertVoid(CUSTOM_TRIGGER_STACK, getCurrentRemainingStack() > EXPECTED_REMAINING_STACK, "calc s"); efiAssertVoid(CUSTOM_TRIGGER_STACK, getCurrentRemainingStack() > EXPECTED_REMAINING_STACK, "calc s");
#endif #endif
triggerCentral->triggerErrorDetection.clear();
shape.initializeSyncPoint(state, triggerCentral->primaryTriggerConfiguration); shape.initializeSyncPoint(initState, primaryTriggerConfiguration);
if (shape.getSize() >= PWM_PHASE_MAX_COUNT) { if (shape.getSize() >= PWM_PHASE_MAX_COUNT) {
// todo: by the time we are here we had already modified a lot of RAM out of bounds! // todo: by the time we are here we had already modified a lot of RAM out of bounds!
@ -1026,11 +1026,13 @@ void TriggerCentral::updateWaveform() {
efiAssertVoid(CUSTOM_SHAPE_LEN_ZERO, length > 0, "shapeLength=0"); efiAssertVoid(CUSTOM_SHAPE_LEN_ZERO, length > 0, "shapeLength=0");
triggerErrorDetection.clear();
/** /**
* 'initState' instance of TriggerDecoderBase is used only to initialize 'this' TriggerWaveform instance * 'initState' instance of TriggerDecoderBase is used only to initialize 'this' TriggerWaveform instance
* #192 BUG real hardware trigger events could be coming even while we are initializing trigger * #192 BUG real hardware trigger events could be coming even while we are initializing trigger
*/ */
calculateTriggerSynchPoint(this, calculateTriggerSynchPoint(primaryTriggerConfiguration,
triggerShape, triggerShape,
initState); initState);
} }