auto-sync
This commit is contained in:
parent
4d2c4258c9
commit
407c2d57b0
|
@ -213,6 +213,15 @@ static void printState(Engine *engine) {
|
||||||
if (subscription[(int) RO_RUNNING_REVOLUTION_COUNTER])
|
if (subscription[(int) RO_RUNNING_REVOLUTION_COUNTER])
|
||||||
debugInt(&logger, "ckp_r", triggerCentral.triggerState.runningRevolutionCounter);
|
debugInt(&logger, "ckp_r", triggerCentral.triggerState.runningRevolutionCounter);
|
||||||
|
|
||||||
|
if (subscription[(int) RO_RUNNING_TRIGGER_ERROR])
|
||||||
|
debugInt(&logger, "trg_r_errors", triggerCentral.triggerState.runningTriggerErrorCounter);
|
||||||
|
|
||||||
|
if (subscription[(int) RO_RUNNING_ORDERING_TRIGGER_ERROR])
|
||||||
|
debugInt(&logger, "trg_r_order_errors", triggerCentral.triggerState.runningOrderingErrorCounter);
|
||||||
|
|
||||||
|
if (subscription[(int) RO_WAVE_CHART_CURRENT_SIZE])
|
||||||
|
debugInt(&logger, "wave_chart_current", 0);
|
||||||
|
|
||||||
// debugInt(&logger, "idl", getIdleSwitch());
|
// debugInt(&logger, "idl", getIdleSwitch());
|
||||||
|
|
||||||
// debugFloat(&logger, "table_spark", getAdvance(rpm, getMaf()), 2);
|
// debugFloat(&logger, "table_spark", getAdvance(rpm, getMaf()), 2);
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#define CONTROLLERS_ALGO_RUSEFI_OUTPUTS_H_
|
#define CONTROLLERS_ALGO_RUSEFI_OUTPUTS_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this enum is part of the console protocol API, it should be in sync with ...java
|
* this enum is part of the console protocol API, it should be in sync with com/rusefi/OutputChannel.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,8 +31,11 @@ typedef enum {
|
||||||
RO_VBATT = 8,
|
RO_VBATT = 8,
|
||||||
RO_TOTAL_REVOLUTION_COUNTER = 9,
|
RO_TOTAL_REVOLUTION_COUNTER = 9,
|
||||||
RO_RUNNING_REVOLUTION_COUNTER = 10,
|
RO_RUNNING_REVOLUTION_COUNTER = 10,
|
||||||
|
RO_WAVE_CHART_CURRENT_SIZE = 11,
|
||||||
|
RO_RUNNING_TRIGGER_ERROR = 12,
|
||||||
|
RO_RUNNING_ORDERING_TRIGGER_ERROR = 13,
|
||||||
|
|
||||||
RO_LAST_ELEMENT = 11
|
RO_LAST_ELEMENT = 14
|
||||||
} rusefi_output_e;
|
} rusefi_output_e;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -291,8 +291,8 @@ float getTriggerDutyCycle(int index) {
|
||||||
return triggerCentral.triggerState.getTriggerDutyCycle(index);
|
return triggerCentral.triggerState.getTriggerDutyCycle(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void resetRunningTriggerCounter() {
|
static void resetRunningTriggerCounters() {
|
||||||
triggerCentral.triggerState.runningRevolutionCounter = 0;
|
triggerCentral.triggerState.resetRunningCounters();
|
||||||
}
|
}
|
||||||
|
|
||||||
void initTriggerCentral(Logging *sharedLogger, Engine *engine) {
|
void initTriggerCentral(Logging *sharedLogger, Engine *engine) {
|
||||||
|
@ -306,7 +306,7 @@ void initTriggerCentral(Logging *sharedLogger, Engine *engine) {
|
||||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
addConsoleActionP("triggerinfo", (VoidPtr) triggerInfo, engine);
|
addConsoleActionP("triggerinfo", (VoidPtr) triggerInfo, engine);
|
||||||
addConsoleActionP("triggershapeinfo", (VoidPtr) triggerShapeInfo, engine);
|
addConsoleActionP("triggershapeinfo", (VoidPtr) triggerShapeInfo, engine);
|
||||||
addConsoleAction("reset_running_trigger_counter", resetRunningTriggerCounter);
|
addConsoleAction("reset_running_counters", resetRunningTriggerCounters);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,12 @@ public:
|
||||||
uint32_t prevTotalTime[PWM_PHASE_MAX_WAVE_PER_PWM];
|
uint32_t prevTotalTime[PWM_PHASE_MAX_WAVE_PER_PWM];
|
||||||
int expectedTotalTime[PWM_PHASE_MAX_WAVE_PER_PWM];
|
int expectedTotalTime[PWM_PHASE_MAX_WAVE_PER_PWM];
|
||||||
uint32_t totalTriggerErrorCounter;
|
uint32_t totalTriggerErrorCounter;
|
||||||
|
uint32_t runningTriggerErrorCounter;
|
||||||
uint32_t orderingErrorCounter;
|
uint32_t orderingErrorCounter;
|
||||||
|
uint32_t runningOrderingErrorCounter;
|
||||||
|
|
||||||
|
void resetRunningCounters();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* index within trigger revolution, from 0 to trigger event count
|
* index within trigger revolution, from 0 to trigger event count
|
||||||
|
|
|
@ -114,9 +114,12 @@ TriggerState::TriggerState() {
|
||||||
shaft_is_synchronized = false;
|
shaft_is_synchronized = false;
|
||||||
toothed_previous_time = 0;
|
toothed_previous_time = 0;
|
||||||
toothed_previous_duration = 0;
|
toothed_previous_duration = 0;
|
||||||
|
|
||||||
totalRevolutionCounter = 0;
|
totalRevolutionCounter = 0;
|
||||||
runningRevolutionCounter = 0;
|
|
||||||
totalTriggerErrorCounter = 0;
|
totalTriggerErrorCounter = 0;
|
||||||
|
orderingErrorCounter = 0;
|
||||||
|
|
||||||
|
resetRunningCounters();
|
||||||
clear();
|
clear();
|
||||||
memset(expectedTotalTime, 0, sizeof(expectedTotalTime));
|
memset(expectedTotalTime, 0, sizeof(expectedTotalTime));
|
||||||
totalEventCountBase = 0;
|
totalEventCountBase = 0;
|
||||||
|
@ -131,6 +134,12 @@ uint64_t TriggerState::getStartOfRevolutionIndex() {
|
||||||
return totalEventCountBase;
|
return totalEventCountBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TriggerState::resetRunningCounters() {
|
||||||
|
runningRevolutionCounter = 0;
|
||||||
|
runningTriggerErrorCounter = 0;
|
||||||
|
runningOrderingErrorCounter = 0;
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t TriggerState::getTotalEventCounter() {
|
uint64_t TriggerState::getTotalEventCounter() {
|
||||||
return totalEventCountBase + current_index;
|
return totalEventCountBase + current_index;
|
||||||
}
|
}
|
||||||
|
|
|
@ -262,5 +262,5 @@ int getRusEfiVersion(void) {
|
||||||
return 1; // this is here to make the compiler happy about the unused array
|
return 1; // this is here to make the compiler happy about the unused array
|
||||||
if (UNUSED_CCM_SIZE == 0)
|
if (UNUSED_CCM_SIZE == 0)
|
||||||
return 1; // this is here to make the compiler happy about the unused array
|
return 1; // this is here to make the compiler happy about the unused array
|
||||||
return 20150117;
|
return 20150118;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue