refactoring

This commit is contained in:
rusefi 2017-11-19 22:09:19 -05:00
parent 16619a6157
commit 87b0049355
2 changed files with 8 additions and 4 deletions

View File

@ -36,7 +36,8 @@ EXTERN_ENGINE;
extern int warningEnabled;
extern bool main_loop_started;
fatal_msg_t errorMessageBuffer;
// todo: rename to fatalErrorMessage?
static fatal_msg_t errorMessageBuffer;
bool hasFirmwareErrorFlag = false;
const char *dbg_panic_file;

View File

@ -25,23 +25,26 @@ void addWarningCode(obd_code_e code);
* Something is wrong, but we can live with it: some minor sensor is disconnected
* or something like that
*
* see also firmwareError()
*/
bool warning(obd_code_e code, const char *fmt, ...);
bool isWarningNow(efitimesec_t now, bool forIndicator);
typedef uint8_t fatal_msg_t[200];
/**
* Something really bad had happened - firmware cannot function
* Something really bad had happened - firmware cannot function, we cannot run the engine
*
* todo: better method name?
* see also warning()
*/
void firmwareError(obd_code_e code, const char *fmt, ...);
#define hasFirmwareError() hasFirmwareErrorFlag
bool isWarningNow(efitimesec_t now, bool forIndicator);
// todo: rename to getFatalErrorMessage
char *getFirmwareError(void);
void initErrorHandling(void);
// todo: rename to getWarningMessage?
char *getWarning(void);
// todo: better place for this shared declaration?