refactoring & verbose trigger to simulator
This commit is contained in:
parent
fe77766b2b
commit
8cf19d3d12
|
@ -308,8 +308,6 @@ static trigger_value_e eventType[6] = { TV_FALL, TV_RISE, TV_FALL, TV_RISE, TV_F
|
||||||
#define needToSkipFall(type) ((!TRIGGER_SHAPE(gapBothDirections)) && (( TRIGGER_SHAPE(useRiseEdge)) && (type != TV_RISE)))
|
#define needToSkipFall(type) ((!TRIGGER_SHAPE(gapBothDirections)) && (( TRIGGER_SHAPE(useRiseEdge)) && (type != TV_RISE)))
|
||||||
#define needToSkipRise(type) ((!TRIGGER_SHAPE(gapBothDirections)) && ((!TRIGGER_SHAPE(useRiseEdge)) && (type != TV_FALL)))
|
#define needToSkipRise(type) ((!TRIGGER_SHAPE(gapBothDirections)) && ((!TRIGGER_SHAPE(useRiseEdge)) && (type != TV_FALL)))
|
||||||
|
|
||||||
#define isLessImportant(type) (needToSkipFall(type) || needToSkipRise(type) || (!considerEventForGap()) )
|
|
||||||
|
|
||||||
int TriggerState::getCurrentIndex() const {
|
int TriggerState::getCurrentIndex() const {
|
||||||
return currentCycle.current_index;
|
return currentCycle.current_index;
|
||||||
}
|
}
|
||||||
|
@ -449,7 +447,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
|
||||||
|
|
||||||
bool isPrimary = triggerWheel == T_PRIMARY;
|
bool isPrimary = triggerWheel == T_PRIMARY;
|
||||||
|
|
||||||
if (isLessImportant(type)) {
|
if (needToSkipFall(type) || needToSkipRise(type) || (!considerEventForGap())) {
|
||||||
#if EFI_UNIT_TEST
|
#if EFI_UNIT_TEST
|
||||||
if (printTriggerDebug) {
|
if (printTriggerDebug) {
|
||||||
printf("%s isLessImportant %s now=%lld index=%d\r\n",
|
printf("%s isLessImportant %s now=%lld index=%d\r\n",
|
||||||
|
@ -552,7 +550,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
|
||||||
actualSynchGap = 1.0 * toothDurations[0] / toothDurations[1];
|
actualSynchGap = 1.0 * toothDurations[0] / toothDurations[1];
|
||||||
#endif /* EFI_UNIT_TEST */
|
#endif /* EFI_UNIT_TEST */
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
if (CONFIG(verboseTriggerSynchDetails) || (someSortOfTriggerError && !silentTriggerError)) {
|
if (CONFIG(verboseTriggerSynchDetails) || (someSortOfTriggerError && !silentTriggerError)) {
|
||||||
for (int i = 0;i<GAP_TRACKING_LENGTH;i++) {
|
for (int i = 0;i<GAP_TRACKING_LENGTH;i++) {
|
||||||
float gap = 1.0 * toothDurations[i] / toothDurations[i + 1];
|
float gap = 1.0 * toothDurations[i] / toothDurations[i + 1];
|
||||||
|
@ -561,7 +559,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
|
||||||
i);
|
i);
|
||||||
} else {
|
} else {
|
||||||
scheduleMsg(logger, "time=%d index=%d: gap=%.2f expected from %.2f to %.2f error=%s",
|
scheduleMsg(logger, "time=%d index=%d: gap=%.2f expected from %.2f to %.2f error=%s",
|
||||||
/* cast is needed to nake sure we do not put 64 bit value to stack*/ (int)getTimeNowSeconds(),
|
/* cast is needed to make sure we do not put 64 bit value to stack*/ (int)getTimeNowSeconds(),
|
||||||
i,
|
i,
|
||||||
gap,
|
gap,
|
||||||
TRIGGER_SHAPE(syncronizationRatioFrom[i]),
|
TRIGGER_SHAPE(syncronizationRatioFrom[i]),
|
||||||
|
|
|
@ -97,6 +97,15 @@ void rusEfiFunctionalTest(void) {
|
||||||
itoa10(versionBuffer, (int)getRusEfiVersion());
|
itoa10(versionBuffer, (int)getRusEfiVersion());
|
||||||
printToConsole(versionBuffer);
|
printToConsole(versionBuffer);
|
||||||
|
|
||||||
|
#if EFI_SHAFT_POSITION_INPUT
|
||||||
|
/**
|
||||||
|
* This is so early because we want to init logger
|
||||||
|
* which would be used while finding trigger sync index
|
||||||
|
* while reading configuration
|
||||||
|
*/
|
||||||
|
initTriggerDecoderLogger(&sharedLogger);
|
||||||
|
#endif /* EFI_SHAFT_POSITION_INPUT */
|
||||||
|
|
||||||
initIntermediateLoggingBuffer();
|
initIntermediateLoggingBuffer();
|
||||||
|
|
||||||
engine->setConfig(config);
|
engine->setConfig(config);
|
||||||
|
|
Loading…
Reference in New Issue