Trigger setup in TS is highly confusing: hide operation mode from users? #4031

This commit is contained in:
Andrey 2022-04-03 01:11:53 -04:00
parent 5840a61f55
commit c2a97343f2
2 changed files with 10 additions and 8 deletions

View File

@ -443,7 +443,7 @@ void TriggerWaveform::setThirdTriggerSynchronizationGap(float syncRatio) {
/** /**
* External logger is needed because at this point our logger is not yet initialized * External logger is needed because at this point our logger is not yet initialized
*/ */
void TriggerWaveform::initializeTriggerWaveform(operation_mode_e ambiguousOperationMode, bool useOnlyRisingEdgeForTrigger, const trigger_config_s *triggerConfig) { void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperationMode, bool useOnlyRisingEdgeForTrigger, const trigger_config_s *triggerConfig) {
#if EFI_PROD_CODE #if EFI_PROD_CODE
efiAssertVoid(CUSTOM_ERR_6641, getCurrentRemainingStack() > EXPECTED_REMAINING_STACK, "init t"); efiAssertVoid(CUSTOM_ERR_6641, getCurrentRemainingStack() > EXPECTED_REMAINING_STACK, "init t");
@ -462,7 +462,7 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e ambiguousOperat
* which touches 'useRiseEdge' flag while here we do not touch it?! * which touches 'useRiseEdge' flag while here we do not touch it?!
*/ */
initializeSkippedToothTriggerWaveformExt(this, triggerConfig->customTotalToothCount, initializeSkippedToothTriggerWaveformExt(this, triggerConfig->customTotalToothCount,
triggerConfig->customSkippedToothCount, ambiguousOperationMode); triggerConfig->customSkippedToothCount, triggerOperationMode);
break; break;
case TT_MAZDA_MIATA_NA: case TT_MAZDA_MIATA_NA:
@ -599,7 +599,7 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e ambiguousOperat
break; break;
case TT_ONE: case TT_ONE:
setToothedWheelConfiguration(this, 1, 0, ambiguousOperationMode); setToothedWheelConfiguration(this, 1, 0, triggerOperationMode);
break; break;
case TT_MAZDA_SOHC_4: case TT_MAZDA_SOHC_4:
@ -611,7 +611,7 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e ambiguousOperat
break; break;
case TT_VVT_JZ: case TT_VVT_JZ:
setToothedWheelConfiguration(this, 3, 0, ambiguousOperationMode); setToothedWheelConfiguration(this, 3, 0, triggerOperationMode);
break; break;
case TT_36_2_1_1: case TT_36_2_1_1:
@ -623,19 +623,19 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e ambiguousOperat
break; break;
case TT_TOOTHED_WHEEL_32_2: case TT_TOOTHED_WHEEL_32_2:
setToothedWheelConfiguration(this, 32, 2, ambiguousOperationMode); setToothedWheelConfiguration(this, 32, 2, triggerOperationMode);
// todo: add this second/third into 'setToothedWheelConfiguration' as long as we have enough tooth? // todo: add this second/third into 'setToothedWheelConfiguration' as long as we have enough tooth?
setSecondTriggerSynchronizationGap(1); // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise setSecondTriggerSynchronizationGap(1); // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise
setThirdTriggerSynchronizationGap(1); setThirdTriggerSynchronizationGap(1);
break; break;
case TT_TOOTHED_WHEEL_60_2: case TT_TOOTHED_WHEEL_60_2:
setToothedWheelConfiguration(this, 60, 2, ambiguousOperationMode); setToothedWheelConfiguration(this, 60, 2, triggerOperationMode);
setSecondTriggerSynchronizationGap(1); // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise setSecondTriggerSynchronizationGap(1); // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise
break; break;
case TT_TOOTHED_WHEEL_36_2: case TT_TOOTHED_WHEEL_36_2:
setToothedWheelConfiguration(this, 36, 2, ambiguousOperationMode); setToothedWheelConfiguration(this, 36, 2, triggerOperationMode);
setSecondTriggerSynchronizationGap(1); // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise setSecondTriggerSynchronizationGap(1); // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise
break; break;
@ -644,7 +644,7 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e ambiguousOperat
break; break;
case TT_TOOTHED_WHEEL_36_1: case TT_TOOTHED_WHEEL_36_1:
setToothedWheelConfiguration(this, 36, 1, ambiguousOperationMode); setToothedWheelConfiguration(this, 36, 1, triggerOperationMode);
setSecondTriggerSynchronizationGap(1); // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise setSecondTriggerSynchronizationGap(1); // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise
break; break;

View File

@ -873,6 +873,8 @@ void onConfigurationChangeTriggerCallback() {
changed |= isConfigurationChanged(trigger.type); changed |= isConfigurationChanged(trigger.type);
changed |= isConfigurationChanged(ambiguousOperationMode); changed |= isConfigurationChanged(ambiguousOperationMode);
changed |= isConfigurationChanged(skippedWheelOnCam);
changed |= isConfigurationChanged(twoStroke);
changed |= isConfigurationChanged(useOnlyRisingEdgeForTrigger); changed |= isConfigurationChanged(useOnlyRisingEdgeForTrigger);
changed |= isConfigurationChanged(globalTriggerAngleOffset); changed |= isConfigurationChanged(globalTriggerAngleOffset);
changed |= isConfigurationChanged(trigger.customTotalToothCount); changed |= isConfigurationChanged(trigger.customTotalToothCount);