shadowing in trigger land

This commit is contained in:
Matthew Kennedy 2023-11-01 15:54:03 -07:00
parent 71dc7b715e
commit baebd29adb
5 changed files with 20 additions and 20 deletions

View File

@ -67,8 +67,8 @@ void TriggerWaveform::initialize(operation_mode_e operationMode, SyncEdge syncEd
shapeDefinitionError = false;
useOnlyPrimaryForSync = false;
this->operationMode = operationMode;
this->syncEdge = syncEdge;
m_operationMode = operationMode;
m_syncEdge = syncEdge;
triggerShapeSynchPointIndex = 0;
memset(expectedEventCount, 0, sizeof(expectedEventCount));
wave.reset();
@ -97,7 +97,7 @@ int TriggerWaveform::getTriggerWaveformSynchPointIndex() const {
* @see getCrankDivider
*/
angle_t TriggerWaveform::getCycleDuration() const {
switch (operationMode) {
switch (m_operationMode) {
case FOUR_STROKE_THREE_TIMES_CRANK_SENSOR:
return FOUR_STROKE_CYCLE_DURATION / SYMMETRICAL_THREE_TIMES_CRANK_SENSOR_DIVIDER;
case FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR:
@ -142,7 +142,7 @@ size_t TriggerWaveform::getLength() const {
* 2 for FOUR_STROKE_CRANK_SENSOR
* 1 otherwise
*/
int multiplier = getEngineCycle(operationMode) / getCycleDuration();
int multiplier = getEngineCycle(m_operationMode) / getCycleDuration();
return multiplier * getSize();
}
@ -165,7 +165,7 @@ angle_t TriggerWaveform::getAngle(int index) const {
void TriggerWaveform::addEventClamped(angle_t angle, bool stateParam, TriggerWheel const channelIndex, float filterLeft, float filterRight) {
if (angle > filterLeft && angle < filterRight) {
addEvent(angle / getEngineCycle(operationMode), stateParam, channelIndex);
addEvent(angle / getEngineCycle(m_operationMode), stateParam, channelIndex);
}
}
@ -174,7 +174,7 @@ void TriggerWaveform::addEventClamped(angle_t angle, bool stateParam, TriggerWhe
* needed to resolve precise mode for vague wheels
*/
operation_mode_e TriggerWaveform::getWheelOperationMode() const {
return operationMode;
return m_operationMode;
}
#if EFI_UNIT_TEST
@ -213,7 +213,7 @@ void TriggerWaveform::addEvent720(angle_t angle, bool state, TriggerWheel const
}
void TriggerWaveform::addEvent360(angle_t angle, bool state, TriggerWheel const channelIndex) {
efiAssertVoid(ObdCode::CUSTOM_OMODE_UNDEF, operationMode == FOUR_STROKE_CAM_SENSOR || operationMode == FOUR_STROKE_CRANK_SENSOR, "Not a mode for 360");
efiAssertVoid(ObdCode::CUSTOM_OMODE_UNDEF, m_operationMode == FOUR_STROKE_CAM_SENSOR || m_operationMode == FOUR_STROKE_CRANK_SENSOR, "Not a mode for 360");
addEvent(CRANK_MODE_MULTIPLIER * angle / FOUR_STROKE_CYCLE_DURATION, state, channelIndex);
}
@ -222,7 +222,7 @@ void TriggerWaveform::addEventAngle(angle_t angle, bool state, TriggerWheel cons
}
void TriggerWaveform::addEvent(angle_t angle, bool state, TriggerWheel const channelIndex) {
efiAssertVoid(ObdCode::CUSTOM_OMODE_UNDEF, operationMode != OM_NONE, "operationMode not set");
efiAssertVoid(ObdCode::CUSTOM_OMODE_UNDEF, m_operationMode != OM_NONE, "operationMode not set");
if (channelIndex == TriggerWheel:: T_SECONDARY) {
needSecondTriggerInput = true;

View File

@ -143,7 +143,7 @@ public:
bool useOnlyPrimaryForSync;
// Which edge(s) to consider for finding the sync point: rise, fall, or both
SyncEdge syncEdge;
SyncEdge m_syncEdge;
// If true, falling edges should be fully ignored on this trigger shape.
bool useOnlyRisingEdges;
@ -264,7 +264,7 @@ private:
/**
* this is part of performance optimization
*/
operation_mode_e operationMode;
operation_mode_e m_operationMode;
};
/**

View File

@ -676,7 +676,7 @@ static void triggerShapeInfo() {
#if EFI_PROD_CODE || EFI_SIMULATOR
TriggerWaveform *shape = &getTriggerCentral()->triggerShape;
TriggerFormDetails *triggerFormDetails = &getTriggerCentral()->triggerFormDetails;
efiPrintf("syncEdge=%s", getSyncEdge(TRIGGER_WAVEFORM(syncEdge)));
efiPrintf("syncEdge=%s", getSyncEdge(TRIGGER_WAVEFORM(m_syncEdge)));
efiPrintf("gap from %.2f to %.2f", TRIGGER_WAVEFORM(syncronizationRatioFrom[0]), TRIGGER_WAVEFORM(syncronizationRatioTo[0]));
for (size_t i = 0; i < shape->getSize(); i++) {
@ -705,7 +705,7 @@ void triggerInfo(void) {
efiPrintf("Template %s (%d) trigger %s (%d) syncEdge=%s tdcOffset=%.2f",
getEngine_type_e(engineConfiguration->engineType), engineConfiguration->engineType,
getTrigger_type_e(engineConfiguration->trigger.type), engineConfiguration->trigger.type,
getSyncEdge(TRIGGER_WAVEFORM(syncEdge)), TRIGGER_WAVEFORM(tdcPosition));
getSyncEdge(TRIGGER_WAVEFORM(m_syncEdge)), TRIGGER_WAVEFORM(tdcPosition));
if (engineConfiguration->trigger.type == trigger_type_e::TT_TOOTHED_WHEEL) {
efiPrintf("total %d/skipped %d", engineConfiguration->trigger.customTotalToothCount,
@ -834,9 +834,9 @@ void onConfigurationChangeTriggerCallback() {
getTriggerCentral()->triggerConfigChangedOnLastConfigurationChange = getTriggerCentral()->triggerConfigChangedOnLastConfigurationChange || changed;
}
static void initVvtShape(TriggerWaveform& shape, const TriggerConfiguration& config, TriggerDecoderBase &initState) {
shape.initializeTriggerWaveform(FOUR_STROKE_CAM_SENSOR, config);
shape.initializeSyncPoint(initState, config);
static void initVvtShape(TriggerWaveform& shape, const TriggerConfiguration& triggerConfig, TriggerDecoderBase &initState) {
shape.initializeTriggerWaveform(FOUR_STROKE_CAM_SENSOR, triggerConfig);
shape.initializeSyncPoint(initState, triggerConfig);
}
void TriggerCentral::validateCamVvtCounters() {

View File

@ -350,7 +350,7 @@ static bool shouldConsiderEdge(const TriggerWaveform& triggerShape, TriggerWheel
return false;
}
switch (triggerShape.syncEdge) {
switch (triggerShape.m_syncEdge) {
case SyncEdge::Both: return true;
case SyncEdge::RiseOnly:
case SyncEdge::Rise: return isRising;

View File

@ -70,10 +70,10 @@ void TriggerStimulatorHelper::feedSimulatedEvent(
constexpr trigger_event_e riseEvents[] = { SHAFT_PRIMARY_RISING, SHAFT_SECONDARY_RISING };
constexpr trigger_event_e fallEvents[] = { SHAFT_PRIMARY_FALLING, SHAFT_SECONDARY_FALLING };
for (size_t i = 0; i < PWM_PHASE_MAX_WAVE_PER_PWM; i++) {
if (needEvent(stateIndex, multiChannelStateSequence, i)) {
bool currentValue = multiChannelStateSequence.getChannelState(/*phaseIndex*/i, stateIndex);
trigger_event_e event = (currentValue ? riseEvents : fallEvents)[i];
for (size_t j = 0; j < PWM_PHASE_MAX_WAVE_PER_PWM; j++) {
if (needEvent(stateIndex, multiChannelStateSequence, j)) {
bool currentValue = multiChannelStateSequence.getChannelState(/*phaseIndex*/j, stateIndex);
trigger_event_e event = (currentValue ? riseEvents : fallEvents)[j];
if (isUsefulSignal(event, shape)) {
state.decodeTriggerEvent(
"sim",