diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index fc0a886b20..ec0358f551 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -338,8 +338,8 @@ void Engine::OnTriggerSyncronization(bool wasSynchronized, bool isDecodingError) if (engineConfiguration->verboseTriggerSynchDetails || (triggerCentral.triggerState.someSortOfTriggerError() && !engineConfiguration->silentTriggerError)) { efiPrintf("error: synchronizationPoint @ index %d expected %d/%d got %d/%d", triggerCentral.triggerState.currentCycle.current_index, - TRIGGER_WAVEFORM(getExpectedEventCount(TriggerWheel::T_PRIMARY)), - TRIGGER_WAVEFORM(getExpectedEventCount(TriggerWheel::T_SECONDARY)), + triggerCentral.triggerShape.getExpectedEventCount(TriggerWheel::T_PRIMARY), + triggerCentral.triggerShape.getExpectedEventCount(TriggerWheel::T_SECONDARY), triggerCentral.triggerState.currentCycle.eventCount[0], triggerCentral.triggerState.currentCycle.eventCount[1]); } diff --git a/firmware/controllers/math/engine_math.h b/firmware/controllers/math/engine_math.h index b779281791..d5f45922aa 100644 --- a/firmware/controllers/math/engine_math.h +++ b/firmware/controllers/math/engine_math.h @@ -58,7 +58,7 @@ void setSingleCoilDwell(); // expectation is that for well-known triggers engineConfiguration->globalTriggerAngleOffset would usually be zero // while for toothed wheels user would have to provide a value #define tdcPosition() \ - (TRIGGER_WAVEFORM(tdcPosition) + engineConfiguration->globalTriggerAngleOffset) + (getTriggerCentral()->triggerShape.tdcPosition + engineConfiguration->globalTriggerAngleOffset) /** Gets phase offset for a particular cylinder's ID and number * For example on 4 cylinder engine with firing order 1-3-4-2, this diff --git a/firmware/controllers/trigger/decoders/trigger_structure.h b/firmware/controllers/trigger/decoders/trigger_structure.h index 688e771a23..b97f8259d0 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.h +++ b/firmware/controllers/trigger/decoders/trigger_structure.h @@ -266,5 +266,3 @@ public: */ angle_t eventAngles[2 * PWM_PHASE_MAX_COUNT]; }; - -#define TRIGGER_WAVEFORM(x) getTriggerCentral()->triggerShape.x diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 967a786684..b0c78809e6 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -38,6 +38,8 @@ WaveChart waveChart; static scheduling_s debugToggleScheduling; #define DEBUG_PIN_DELAY US2NT(60) +#define TRIGGER_WAVEFORM(x) getTriggerCentral()->triggerShape.x + #if EFI_SHAFT_POSITION_INPUT TriggerCentral::TriggerCentral() :