Live Data VVT counter

This commit is contained in:
rusEfi 2019-09-02 14:47:05 -04:00
parent 52462550dd
commit 2aee194f3b
9 changed files with 25 additions and 10 deletions

View File

@ -1,4 +1,4 @@
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/trigger.txt Sat Aug 31 23:11:37 EDT 2019
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/trigger_state.txt Mon Sep 02 13:51:51 EDT 2019
// by class com.rusefi.output.CHeaderConsumer
// begin
#ifndef CONTROLLERS_GENERATED_TRIGGER_GENERATED_H
@ -12,11 +12,15 @@ struct trigger_central_s {
* offset 0
*/
int hwEventCounters[HW_EVENT_TYPES];
/** total size 24*/
/**
* offset 24
*/
int vvtCamCounter = (int)0;
/** total size 28*/
};
typedef struct trigger_central_s trigger_central_s;
#endif
// end
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/trigger.txt Sat Aug 31 23:11:37 EDT 2019
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/trigger_state.txt Mon Sep 02 13:51:51 EDT 2019

View File

@ -498,7 +498,7 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEventIndex D
if (trgEventIndex == 0) {
if (HAVE_CAM_INPUT()) {
engine->triggerCentral.triggerState.validateCamVvtCounters();
engine->triggerCentral.validateCamVvtCounters();
}
if (checkIfTriggerConfigChanged(PASS_ENGINE_PARAMETER_SIGNATURE)) {

View File

@ -103,7 +103,7 @@ void hwHandleVvtCamSignal(trigger_value_e front DECLARE_ENGINE_PARAMETER_SUFFIX)
}
TriggerCentral *tc = &engine->triggerCentral;
tc->triggerState.vvtCamCounter++;
tc->vvtCamCounter++;
efitick_t nowNt = getTimeNowNt();

View File

@ -32,6 +32,7 @@ public:
void resetCounters();
void resetAccumSignalData();
bool noiseFilter(efitick_t nowNt, trigger_event_e signal DECLARE_ENGINE_PARAMETER_SUFFIX);
void validateCamVvtCounters();
TriggerStateWithRunningStatistics triggerState;
efitick_t nowNt = 0;
angle_t vvtPosition = 0;

View File

@ -309,9 +309,9 @@ int TriggerState::getCurrentIndex() const {
return currentCycle.current_index;
}
void TriggerState::validateCamVvtCounters() {
void TriggerCentral::validateCamVvtCounters() {
// micro-optimized 'totalRevolutionCounter % 256'
int camVvtValidationIndex = totalRevolutionCounter & 0xFF;
int camVvtValidationIndex = triggerState.getTotalRevolutionCounter() & 0xFF;
if (camVvtValidationIndex == 0) {
vvtCamCounter = 0;
} else if (camVvtValidationIndex == 0xFE && vvtCamCounter < 60) {
@ -500,6 +500,11 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
DISPLAY(DISPLAY_FIELD(HWEVENTCOUNTERS3));
DISPLAY_TEXT(Rise);
DISPLAY(DISPLAY_FIELD(HWEVENTCOUNTERS4));
DISPLAY_TEXT(EOL);
DISPLAY_TEXT(VVT_1);
DISPLAY(DISPLAY_CONFIG(CAMINPUTS1));
DISPLAY(DISPLAY_FIELD(vvtCamCounter));
if (triggerShape->isSynchronizationNeeded) {
// this is getting a little out of hand, any ideas?

View File

@ -56,7 +56,6 @@ public:
* this is important for crank-based virtual trigger and VVT magic
*/
bool isEvenRevolution() const;
void validateCamVvtCounters();
void incrementTotalEventCounter();
efitime_t getTotalEventCounter() const;
void decodeTriggerEvent(trigger_event_e const signal, efitime_t nowUs DECLARE_ENGINE_PARAMETER_SUFFIX);
@ -111,7 +110,6 @@ public:
* for virtual double trigger see timeAtVirtualZeroNt
*/
efitick_t startOfCycleNt;
int vvtCamCounter = 0;
private:
void resetCurrentCycleState();

View File

@ -4,5 +4,6 @@ struct_no_prefix define_constructor trigger_central_s
int[HW_EVENT_TYPES iterate] hwEventCounters;
int vvtCamCounter
end_struct

View File

@ -1,6 +1,6 @@
package com.rusefi.config.generated;
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/trigger_state.txt Sat Jul 20 12:28:04 EDT 2019
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/trigger_state.txt Mon Sep 02 13:51:51 EDT 2019
// by class com.rusefi.output.JavaFieldsConsumer
import com.rusefi.config.*;
@ -13,6 +13,7 @@ public class TriggerState {
public static final Field HWEVENTCOUNTERS4 = Field.create("HWEVENTCOUNTERS4", 12, FieldType.INT);
public static final Field HWEVENTCOUNTERS5 = Field.create("HWEVENTCOUNTERS5", 16, FieldType.INT);
public static final Field HWEVENTCOUNTERS6 = Field.create("HWEVENTCOUNTERS6", 20, FieldType.INT);
public static final Field VVTCAMCOUNTER = Field.create("VVTCAMCOUNTER", 24, FieldType.INT);
public static final Field[] VALUES = {
HWEVENTCOUNTERS1,
HWEVENTCOUNTERS2,
@ -20,5 +21,6 @@ public class TriggerState {
HWEVENTCOUNTERS4,
HWEVENTCOUNTERS5,
HWEVENTCOUNTERS6,
VVTCAMCOUNTER,
};
}

View File

@ -15,5 +15,9 @@ public class TriggerDecoderMeta {
new FieldRequest("Trigger", "HWEVENTCOUNTERS3"),
new TextRequest("Rise"),
new FieldRequest("Trigger", "HWEVENTCOUNTERS4"),
new TextRequest("EOL"),
new TextRequest("VVT_1"),
new ConfigRequest("CAMINPUTS1"),
new FieldRequest("Trigger", "vvtCamCounter"),
};
}