auto-sync
This commit is contained in:
parent
e8c708eabc
commit
704a5113bc
|
@ -22,7 +22,8 @@ int getVtSizeEstimate(void);
|
||||||
|
|
||||||
void assertVtList(void);
|
void assertVtList(void);
|
||||||
|
|
||||||
void setWarningCode(obd_code_e code, efitimesec_t now);
|
void addWarningCode(obd_code_e code);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Something is wrong, but we can live with it: some minor sensor is disconnected
|
* Something is wrong, but we can live with it: some minor sensor is disconnected
|
||||||
* or something like that
|
* or something like that
|
||||||
|
|
|
@ -71,9 +71,7 @@ bool isWarningNow(efitimesec_t now, bool forIndicator) {
|
||||||
return absI(now - engine->engineState.timeOfPreviousWarning) < period;
|
return absI(now - engine->engineState.timeOfPreviousWarning) < period;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setWarningCode(obd_code_e code, efitimesec_t now) {
|
void addWarningCode(obd_code_e code) {
|
||||||
engine->engineState.timeOfPreviousWarning = now;
|
|
||||||
|
|
||||||
engine->engineState.warningCounter++;
|
engine->engineState.warningCounter++;
|
||||||
engine->engineState.lastErrorCode = code;
|
engine->engineState.lastErrorCode = code;
|
||||||
}
|
}
|
||||||
|
@ -92,10 +90,12 @@ bool warning(obd_code_e code, const char *fmt, ...) {
|
||||||
printf("warning %s\r\n", fmt);
|
printf("warning %s\r\n", fmt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
addWarningCode(code);
|
||||||
|
|
||||||
efitimesec_t now = getTimeNowSeconds();
|
efitimesec_t now = getTimeNowSeconds();
|
||||||
if (isWarningNow(now, false) || !warningEnabled)
|
if (isWarningNow(now, false) || !warningEnabled)
|
||||||
return true; // we just had another warning, let's not spam
|
return true; // we just had another warning, let's not spam
|
||||||
setWarningCode(code, now);
|
engine->engineState.timeOfPreviousWarning = now;
|
||||||
|
|
||||||
resetLogging(&logger); // todo: is 'reset' really needed here?
|
resetLogging(&logger); // todo: is 'reset' really needed here?
|
||||||
appendMsgPrefix(&logger);
|
appendMsgPrefix(&logger);
|
||||||
|
|
|
@ -259,7 +259,7 @@ void chDbgStackOverflowPanic(Thread *otp) {
|
||||||
void firmwareError(obd_code_e code, const char *errorMsg, ...) {
|
void firmwareError(obd_code_e code, const char *errorMsg, ...) {
|
||||||
if (hasFirmwareErrorFlag)
|
if (hasFirmwareErrorFlag)
|
||||||
return;
|
return;
|
||||||
setWarningCode(code, getTimeNowSeconds());
|
addWarningCode(code);
|
||||||
ON_FATAL_ERROR()
|
ON_FATAL_ERROR()
|
||||||
;
|
;
|
||||||
hasFirmwareErrorFlag = true;
|
hasFirmwareErrorFlag = true;
|
||||||
|
|
Loading…
Reference in New Issue