trigger refactoring

only:mre_f4
This commit is contained in:
Andrey 2023-03-03 00:21:40 -05:00
parent 057b067db0
commit e08cdf0fb6
4 changed files with 6 additions and 6 deletions

View File

@ -405,8 +405,7 @@ void TriggerWaveform::setThirdTriggerSynchronizationGap(float syncRatio) {
/**
* External logger is needed because at this point our logger is not yet initialized
*/
void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperationMode, const TriggerConfiguration& triggerConfig) {
const trigger_config_s &triggerType = triggerConfig.TriggerType;
void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperationMode, const trigger_config_s &triggerType) {
#if EFI_PROD_CODE
efiAssertVoid(CUSTOM_ERR_6641, getCurrentRemainingStack() > EXPECTED_REMAINING_STACK, "init t");

View File

@ -60,7 +60,7 @@ class TriggerConfiguration;
class TriggerWaveform {
public:
TriggerWaveform();
void initializeTriggerWaveform(operation_mode_e triggerOperationMode, const TriggerConfiguration& triggerConfig);
void initializeTriggerWaveform(operation_mode_e triggerOperationMode, const trigger_config_s &triggerType);
void setShapeDefinitionError(bool value);
/**

View File

@ -1009,7 +1009,7 @@ void onConfigurationChangeTriggerCallback() {
}
static void initVvtShape(TriggerWaveform& shape, const TriggerConfiguration& config, TriggerDecoderBase &initState) {
shape.initializeTriggerWaveform(FOUR_STROKE_CAM_SENSOR, config);
shape.initializeTriggerWaveform(FOUR_STROKE_CAM_SENSOR, config.TriggerType);
shape.initializeSyncPoint(initState, config);
}
@ -1058,7 +1058,7 @@ void TriggerCentral::updateWaveform() {
vvtTriggerConfiguration[camIndex].update();
}
triggerShape.initializeTriggerWaveform(lookupOperationMode(), primaryTriggerConfiguration);
triggerShape.initializeTriggerWaveform(lookupOperationMode(), primaryTriggerConfiguration.TriggerType);
/**
* this is only useful while troubleshooting a new trigger shape in the field

View File

@ -32,8 +32,9 @@ struct MockTriggerDecoder : public TriggerDecoderBase {
};
static auto makeTriggerShape(operation_mode_e mode, const TriggerConfiguration& config) {
// huh? do we return local method instance? how come it's not a SegmFault? is it not allocated on stack?!
TriggerWaveform shape;
shape.initializeTriggerWaveform(mode, config);
shape.initializeTriggerWaveform(mode, config.TriggerType);
return shape;
}