mirror of https://github.com/rusefi/rusefi-1.git
auto-sync
This commit is contained in:
parent
e8c708eabc
commit
704a5113bc
|
@ -22,7 +22,8 @@ int getVtSizeEstimate(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
|
||||
* or something like that
|
||||
|
|
|
@ -71,9 +71,7 @@ bool isWarningNow(efitimesec_t now, bool forIndicator) {
|
|||
return absI(now - engine->engineState.timeOfPreviousWarning) < period;
|
||||
}
|
||||
|
||||
void setWarningCode(obd_code_e code, efitimesec_t now) {
|
||||
engine->engineState.timeOfPreviousWarning = now;
|
||||
|
||||
void addWarningCode(obd_code_e code) {
|
||||
engine->engineState.warningCounter++;
|
||||
engine->engineState.lastErrorCode = code;
|
||||
}
|
||||
|
@ -92,10 +90,12 @@ bool warning(obd_code_e code, const char *fmt, ...) {
|
|||
printf("warning %s\r\n", fmt);
|
||||
#endif
|
||||
|
||||
addWarningCode(code);
|
||||
|
||||
efitimesec_t now = getTimeNowSeconds();
|
||||
if (isWarningNow(now, false) || !warningEnabled)
|
||||
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?
|
||||
appendMsgPrefix(&logger);
|
||||
|
|
|
@ -259,7 +259,7 @@ void chDbgStackOverflowPanic(Thread *otp) {
|
|||
void firmwareError(obd_code_e code, const char *errorMsg, ...) {
|
||||
if (hasFirmwareErrorFlag)
|
||||
return;
|
||||
setWarningCode(code, getTimeNowSeconds());
|
||||
addWarningCode(code);
|
||||
ON_FATAL_ERROR()
|
||||
;
|
||||
hasFirmwareErrorFlag = true;
|
||||
|
|
Loading…
Reference in New Issue