log current engine phase on trigger teeth (#3471)
* log phase on trigger teeth * ui * guard
This commit is contained in:
parent
c28af491bc
commit
f45d365f24
|
@ -135,7 +135,7 @@ struct TunerStudioOutputChannels {
|
|||
scaled_percent iatCorrection; // 64
|
||||
scaled_percent cltCorrection; // 66
|
||||
scaled_percent baroCorrection; // 68
|
||||
uint16_t unused70; // 70
|
||||
uint16_t currentEnginePhase; // 70
|
||||
|
||||
// Wall model AE
|
||||
scaled_ms wallFuelAmount; // 72
|
||||
|
|
|
@ -884,6 +884,14 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
}
|
||||
}
|
||||
|
||||
void updateCurrentEnginePhase(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
if (auto phase = engine->triggerCentral.getCurrentEnginePhase(getTimeNowNt())) {
|
||||
tsOutputChannels.currentEnginePhase = phase.Value - tdcPosition();
|
||||
} else {
|
||||
tsOutputChannels.currentEnginePhase = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void prepareTunerStudioOutputs(void) {
|
||||
// sensor state for EFI Analytics Tuner Studio
|
||||
updateTunerStudioState(&tsOutputChannels PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
void updateDevConsoleState(void);
|
||||
void prepareTunerStudioOutputs(void);
|
||||
void updateCurrentEnginePhase(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void startStatusThreads(void);
|
||||
void initStatusLoop(void);
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "tooth_logger.h"
|
||||
#include "map_averaging.h"
|
||||
#include "main_trigger_callback.h"
|
||||
#include "status_loop.h"
|
||||
|
||||
#if EFI_TUNER_STUDIO
|
||||
#include "tunerstudio.h"
|
||||
|
@ -658,6 +659,10 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
|
|||
#endif
|
||||
|
||||
mainTriggerCallback(triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
#if EFI_TUNER_STUDIO
|
||||
updateCurrentEnginePhase(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -426,6 +426,8 @@ enable2ndByteCanID = false
|
|||
rawTps1Secondary = scalar, U16, 300, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
|
||||
rawTps2Primary = scalar, U16, 302, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
|
||||
rawTps2Secondary = scalar, U16, 304, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
|
||||
|
||||
currentEnginePhase = scalar, U16, 70, "deg", 1, 0
|
||||
;
|
||||
; see TunerStudioOutputChannels struct
|
||||
;
|
||||
|
@ -1031,6 +1033,7 @@ gaugeCategory = Sensors - Extra 2
|
|||
speedToRpmRatioGauge = speedToRpmRatio, "speed2rpm", "", 0, 100, 0, 0, 100, 100, 4, 4
|
||||
wastegatePosGauge = wastegatePositionSensor, @@GAUGE_NAME_WG_POSITION@@, "%", 0, 100, 0, 0, 100, 100, 1, 1
|
||||
idlePosSensGauge = idlePositionSensor, @@GAUGE_NAME_IDLE_POSITION@@, "%", 0, 100, 0, 0, 100, 100, 1, 1
|
||||
currentEnginePhaseGauge = currentEnginePhase, "Engine Phase", "deg", 0, 720, 0, 0, 720, 720, 0, 0
|
||||
|
||||
gaugeCategory = ECU Status
|
||||
warningCounterGauge = warningCounter, @@GAUGE_NAME_WARNING_COUNT@@, "", 0, 100, 0, 0, 100, 100, 0, 0
|
||||
|
@ -1439,6 +1442,7 @@ gaugeCategory = DynoView
|
|||
entry = VssAcceleration, "Vss Accel", float, "%.3f"
|
||||
|
||||
entry = flexPercent, @@GAUGE_NAME_FLEX@@, int, "%d"
|
||||
entry = currentEnginePhase, "Engine Phase", int, "%d"
|
||||
|
||||
[Menu]
|
||||
|
||||
|
|
Loading…
Reference in New Issue