consistency for max counters reset

This commit is contained in:
rusefi 2017-05-19 21:52:10 -04:00
parent 79314e4364
commit 1c6d530f1c
3 changed files with 8 additions and 2 deletions

View File

@ -100,6 +100,7 @@ void writeToFlashNow(void) {
}
assertEngineReference(PASS_ENGINE_PARAMETER_SIGNATURE);
maxLockTime = 0;
resetMaxValues();
}
static bool isValidCrc(persistent_config_container_s *state) {

View File

@ -397,6 +397,10 @@ extern uint32_t *cyccnt;
extern int vvtEventRiseCounter;
extern int vvtEventFallCounter;
void resetMaxValues() {
maxEventQueueTime = triggerMaxDuration = 0;
}
void triggerInfo(void) {
#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__)
@ -437,7 +441,7 @@ void triggerInfo(void) {
scheduleMsg(logger, "gap from %f to %f", ts->syncRatioFrom, ts->syncRatioTo);
}
#endif
#endif /* EFI_PROD_CODE || EFI_SIMULATOR */
#if EFI_PROD_CODE || defined(__DOXYGEN__)
if (engineConfiguration->camInput != GPIO_UNASSIGNED) {
@ -495,7 +499,7 @@ void triggerInfo(void) {
scheduleMsg(logger, "hwSetTimerTime %d", hwSetTimerTime);
scheduleMsg(logger, "totalTriggerHandlerMaxTime=%d", triggerMaxDuration);
triggerMaxDuration = 0;
resetMaxValues();
#endif /* EFI_PROD_CODE */
}

View File

@ -61,5 +61,6 @@ void printAllTriggers();
void addTriggerEventListener(ShaftPositionListener handler, const char *name, Engine *engine);
int isSignalDecoderError(void);
void resetMaxValues();
#endif /* TRIGGER_CENTRAL_H_ */