/** * @file error_handling.h * * @date Mar 6, 2014 * @author Andrey Belomutskiy, (c) 2012-2014 */ #ifndef ERROR_HANDLING_H_ #define ERROR_HANDLING_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include "obd_error_codes.h" /** * Something is wrong, but we can live with it: some minor sensor is disconnected * or something like that * */ int warning(obd_code_e code, const char *fmt, ...); /** * Something really bad had happened - firmware cannot function * * todo: better method name? */ void firmwareError(const char *fmt, ...); int hasFatalError(void); void fatal3(char *msg, char *file, int line); #define fatal(x) (fatal3(x, __FILE__, __LINE__)); void chDbgPanic3(const char *msg, const char * file, int line); void initErrorHandling(void); // todo: better place for this shared declaration? int getRusEfiVersion(void); #define efiAssert(x, y) chDbgAssert(x, y, NULL) #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* ERROR_HANDLING_H_ */